Error Message-The source attachment does not contain the source for the file ListView.class
- by user603695
Hello, new to Android. I get the following message in the debugger perspective:
The source attachment does not contain the source for the file ListView.class
You can change the source attachment by clicking the change attached Source Below
Needless to say the app errors. I've tried to change the source attachment to the location path:
C:/Program Files/Android/android-sdk-windows/platforms/android-8/android.jar
However, this did not work.
Any thoughts would be much appreciated.
Code is:
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...
Thanks!