If you mean how to add context menu to your list - this is how you do
it
in your OnCreate add
registerForContextMenu(getListView());
and then overwrite 2 methods
and then overwrite 2 methods
@Override
public boolean onContextItemSelected(MenuItem item)
{
AdapterContextMenuInfo info = (AdapterContextMenuInfo)
item.getMenuInfo();
Toast.makeText(this, "Longpress: " + info.position,
Toast.LENGTH_SHORT).show();
return true;
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo)
{
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
int selPos = info.position;
menu.add("My Context Menu Item");
}
I think that's it
On Jan 12, 12:35 pm, J. Pablo Fernández <[email protected]> wrote:
> Hello,
>
> Any ideas how to implement long click on the items of a ListActivity
> that is build using a ListAdapter and no layout, just the built in.
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---