I want to start new Activity when i click on ListView's content
ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
Intent i = new Intent(this, contents.class);
startActivityForResult(i, 1);
But when i click on ListView it encounters en error. Tell me where i m wrong开发者_开发百科????
You need to learn how to Debug in Eclipse and how to use the ADB and DDMS tools.
In order to get more details about an exception/force close you need to look for a view in Eclipse called Logcat(you will find in the DDMS perspective) there you will find a detailed traceback when/what and on what line is the issue.
For this you should read a complete article about Debugging in Android using Eclipse
(source: droidnova.com)
精彩评论