android - how to set the selected listview item as header for contextmenu? -


I'm several positions found what I posting deals with but someone tell me a little complicated ListView population of them With this to databases I have been populating my list visibility like this.

  last listView lv = (ListView) getView () findViewById (R.id.mylistview); From string [] = {"sender", "subject", "file_name"}; For Int [] = {RID.Senderer, RID.Subject, R.id.file_name}; List Adapter Adapter = New Simple Adapter (getActivity (), MeristList, R.Lay Out.Lite_item, from,); Lv.setAdapter (adapter); RegisterForContextMenu (lv);  

So far the code is okay, as long as the list view is displaying the context menu like I'm displaying the context menu:

  public void onCreateContextMenu (ContextMenu menu, View v, ContextMenuInfo menuInfo) {if (v.getId () == R.id.mylistview) {AdapterView.AdapterContextMenuInfo information = (AdapterView.AdapterContextMenuInfo) menuInfo; String [] menu item = resource () received GetStringArray (R.Eire Menu); For (int i = 0; i  

Now I want to set R.id.sender as the header of the context menu How to do this? Thanks for any help.

Later, it found itself:

  public void onCreateContextMenu (ContextMenu Menu, see V, ContactMenuFfo MenuInfo) {Hashmap & lt; String, string & gt; H = new Hashmap  string, string> gt; lv.getItemAtPosition); String s = h.get ("sender"); Menu.setHeaderTitle (s); For (int i = 0; i  

Comments