Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Popup Menu Question

 
Ryan Lemon
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting an error saying that the constructor PopupMenu(this, v) is undefined, even though I have it imported (see 2nd comment). Am I missing something here? -SOLVED: I had the method in the wrong file; because of this, as Ron stated, I was calling the wrong instance in my constructor.

ANOTHER Problem: The Popup Menu isn't populated with my menu items, it just has a "Settings" item, see my next post 3 posts down.




 
Ron McLeod
Bartender
Pie
Posts: 1049
65
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The parameter this that you are passing is an instance of CreateLGPopup, not Context.

edit: since you had a View reference, you could have gotten context using View#getContext()
 
Ron McLeod
Bartender
Pie
Posts: 1049
65
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too bad that you decided to remove the code from your original post - this is a common error and would have been helpful for others.
 
Ryan Lemon
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, bad habit. Re-added the code. The Popup Menu works, but it's showing the correct items, it only shows "Settings", yet my createlgmenu.xml says this:



The two popup menu items are Create List & Create Food Group (I'm creating a grocery list application).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic