okubax wrote:
> Hi, I am new to developing apps on the android platform, I have just
> created a simple file manager, I can browse and see my file but I want
> to add context menus to move, delete and rename files and directories.
> How can I go about this ?

Override onCreateContextMenu() and populate the Menu object that you are
given.

Then, override onContextItemSelected(). You will be told which action
the user chose via the supplied MenuItem parameter. If your file manager
is implemented as a ListView or similar sort of AdapterView, you can
cast the result of calling getMenuInfo() on the MenuItem to an
AdapterView.AdapterContextMenuInfo, so you can then figure out which
item was long-tapped-upon to get the context menu.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to