after i user logcat. I want to see position value it is = null final ListView viewInfo = (ListView)findViewById(R.id.listView1); final SWFForeCastInfoLayoutAdapter adapter = new SWFForeCastInfoLayoutAdapter(this, data, data.getCurrentConditionData()); viewInfo.setAdapter(adapter); // adapter.notifyDataSetChanged(); viewInfo.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, final int position, long id) { AlertDialog.Builder adb=new AlertDialog.Builder(SearchActivity.this); adb.setTitle("Delete?"); adb.setMessage("Are you sure you want to delete " + data.getCity()); final int positionToRemove = position; adb.setNegativeButton("Cancel", null); adb.setPositiveButton("Ok", new AlertDialog.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub adapter.getItem(positionToRemove); Log.i("test", "test"+ adapter.getItem(positionToRemove)); adapter.notifyDataSetChanged(); }}); adb.show(); } });
2011/9/1, TreKing <treking...@gmail.com>: > On Thu, Sep 1, 2011 at 8:17 AM, Tawisak Ruksuwan <tawisak.ruksu...@gmail.com >> wrote: > >> when i click for remove item in listview . it is show force close msg > > > Use LogCat and your debugger to track down your problem. At the very least > post a stack trace. > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en