android -Menu function -
I'm new to Android. I have tested android.view.menu by the following code..It works.
Import android.app.activity; Importroid.os.Bundle; Import android.view.Menu; Public class increases menu activity {/ ** is called when activity first created. * / @ Override Crate on Public Zero (Bundle Saved Instantstate) {Super. Contents (Saved Instantstate); SetContentView (R.layout.main); } Public Boolean onCreateOptionsMenu (menu menu) {menu.add (Menu.NONE, 1, Menu.NONE, "1 pixel"); Menu.add (Menu.NONE, 2, Menu.NONE, "2 pixels"); Menu.add (Menu.NONE, 3, Menu.NONE, "8 pixels"); Menu.add (Menu.NONE, 4, Menu.NONE, "16 pixels"); Menu.add (Menu.NONE, 5, Menu.NONE, "24 pixels"); Menu.add (Menu.NONE, 6, Menu.NONE, "32 pixels"); Menu.add (Menu.NONE, 7, Menu.NONE, "40 pixels"); Return (super.onCreateOptionsMenu (menu)); }}
I know how to perform actions in each menu what I have to do. Can we add intent to each menu button? It is possible that please help me. Thank you in advance ..
Comments
Post a Comment