• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

onContextItemSelected method for a table row

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I am creating an activity which contains one table. When selecting a row, i want to update or delete the row through context menu options.
The table is within TableLayout view. Each row is added to the TableLayout as a TableRow view, and also for each TableRow i registered it for context menu with registerForContextMenu(tr);

The context menu options are displaied when selecting a row, but the problem is that i need the number of the selected row . I tought that this could be achieved with the following source code in the onContextItemSelected( MenuItem item ) method :


but the AdapterContextMenuInfo is always null.

Could i achieve the table row by other method?
 
It means our mission is in jeapordy! Quick, read this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic