i want to change my ContextMenu based on my layout – and for that i need to determine
what layout i`m using after the long click was clicked.
-
how can i determine my layout name ?
-
how can i use 2 different ContextMenu`s in one activity ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You must know it when you set it surely?
In your
Activityset an instance member to the layout…You can use any number of context menus in one
Activity. You can have a different context menu for every single UI element in theActivityif you really want to. In other words eachEditTextorImageViewand so on can have its own. You just have to register them.See the docs for onCreateContextMenu for how you create each context menu depending on which view it is.