Error message - the original attachment does not contain a source for the ListView.class file

for Android. In the debugger view, I get the following message:

The source attachment does not contain a source for the ListView.class file. You can change the source application by clicking the "Source below" link

Needless to say about application errors. I tried changing the original attachment to the location path:

C: / Program Files / Android / android-sdk-windows / platform / android-8 / android.jar

However, this did not work.

Any thoughts would be greatly appreciated.

The code:

import android.app.ListActivity;
import android.os.Bundle;
import android.view.*;
import android.widget.*;


public class HelloListView extends ListActivity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

      setListAdapter(new ArrayAdapter<String>(this, R.layout.main, COUNTRIES));

      ListView lv = getListView();
      lv.setTextFilterEnabled(true);

     lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,
            int position, long id) {
          // When clicked, show a toast with the TextView text
          Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
              Toast.LENGTH_SHORT).show();
        }
      });
    }


    static final String[] COUNTRIES = new String[] {
        "Afghanistan", "Albania", "Algeria", "American Samoa...

Thank!

+5
source share
3 answers

The source attachment does not contain the source for the file ListView.class

Needless to say about application errors.

, ListView, , . , , , . , , , . Android, , .

, - , . , LogCat , .

+4

, , , , . , , , F6, . - :

this InvocationTargetException (id =????????)
IllegalStateException (id =????????)
ClassCastException (id =????????)
detailMessage "ArrayAdapter , TextView" (id =????????)

, :

setListAdapter(new ArrayAdapter<String>(this, R.layout.main, COUNTRIES));

setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, COUNTRIES));

+2

, . Eclipse, " ", , (, C:/Program Files/Java/jdk1.6.0_24/src.zip).

> a > Java > JRE System Library. rt.jar. " " "". ( ...) OK.

: http://android.okhelp.cz/class-file-editor-source-not-found-change-attached-source-eclipse/

+2

All Articles