java - Calling onCreateOptionsMenu() from multiple views -
This may be due to the lack of full understanding of how Java works. Still learning!
Let's say we have an activity with the create code.
Enhances game activity in the public category {@Override public void onCreate {bundled saved instance} {super.onCreate (savedInstanceState); SetContentView (new gamemanview (this)); }} We have now found our view. My question is, the game activity class and GameMainView are sub-routes in the class which I want to call using reactions from the CreateOptems menu () . How do I get access to those two classes? I know that I can create an intangible category specifically for the Crack Options menu () and it requires game activity and game modes that they need to do. Is this the only option? OnCreateOptionsMenu () is called only once? And if so, where? If I override it everywhere, will they execute all?
If you write your activity this:
public class Enhances game activity {Private GameManewew GameManview; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); GameMainView = New GameManview (this); SetContentView (gameMainView); }} Then handles the selected menu option in your method, you can deal with the selection in the activity, and you can do it further in the scene.
Comments
Post a Comment