开发者

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

I want to start new Activity when i click on ListView's content


(source: droidnova.com)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜