开发者

onListItemClick generates ForceClose when clicking on item of list

I am using following code:

public class myclass extends ListActivity implements OnItemClickListener{  
//oncreate()  
   {.............}      
 protected void onListItemClick(ListView l, View v, int position, long id) { 开发者_开发知识库 
        super.onListItemClick(l, v, position, id);

//.....

startActivityForResult(intentname,0);
myclass.this.finish();  
}  
}

Problem is>> When i click any item in list by mouse(for test on vm) it shows Force Close But works fine with Return(Enter) key...

Thanks in advance !!!


you can use this..

place the below given code in OnListItemClickListener..

Object o = this.getListAdapter().getItem(position); String place = o.toString();


You have to @Override the onListItemClick().
Are you doing that?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜