On 18/05/12 13:47, Tadas Martinkus wrote:
>
> Hello,
> In code I have listview which is saving in Arraylist<Day>. Everything with
> item adding work, but i want to delete it using long click listener. I use
> some tutorials but it doesn't work - when i run program it get froce close.
> i use this source code.
>
> listView_monday = (ListView)
> findViewById(R.id.myListview_monday);
>
> listView_monday.setAdapter(new
> ArrayAdapter<Day>(this,R.layout.list_view_monday,
> SilentClockActivity.listas_monday));
>
> listView_monday.setOnItemLongClickListener(new
> AdapterView.OnItemLongClickListener() {
>
> @Override
> public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
> int arg2, long arg3) {
> // TODO Auto-generated method stub
> return false;
> }
> });
> If i understand good i need to get postition of lsitview item, and romeve
> it, but how to do it?
>
Think about the role of the adapter and you'll find the solution...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en