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
{
@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) {
Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
Toast.LENGTH_SHORT).show();
}
});
}
static final String[] COUNTRIES = new String[] {
"Afghanistan", "Albania", "Algeria", "American Samoa...
Thank!
source
share