android - More than one registerForContextMenu(View v) handling -


I have 4 * 7 tables and I want to handle every edited text there, when the user is on the 5th edited text Clicks for a long time enough that the menu pop up can choose what color he wants.

The problem is that how should I do this, I have 4 * 7 editors, so I should call the RegisterForrentaxMenu (View) 28 times I have done so that I can choose it from the cantext item Am (menu system)?

I do not want to see the whole section of the scene when the user clicks on any situation for a long time, the menu will pop up, so I do not want to do this.

Edit:

I tried to do it in the KreteContext menu:

  if (v.getId () == R.id. Table_item1) {condition = 1; }  

and check the status in onContextItemSelected, is there a better way / faster way to do this? Since I will need 28 there: (

You can edit your EditTexts , edit1, Edit2, edit3 etc. Then you can do a loop

 for  (int i = 1; i & lt; = 28; ++ i) {int resId = getResources.getIdentifier "edited Do "+ i," id ", getPackageName ()); EditTit edt = (EditText) findViewById (resId); Edt.registerForContextMenu (...)}  

and in other places where you have your EditText s

To be repeated on

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -