开发者

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

开发者 https://www.devze.com 2023-01-08 09:49 出处:网络
ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() {
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

精彩评论

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