Keyhandling

Put your problem here if it does not fit any of the other categories.

Keyhandling

Postby krishnan » Wed Jun 09, 2010 8:13 am

Hi
I am new to android. and trying to check what key is pressed from the emulator keyboard.
Here is my code. Which is not giving me expected results. I have commented some of the code as that was not working.
Please let me know how i can fix this issue.

Code: Select all
public class DynamicMenu extends Activity{
//implements OnKeyListener {
    Menu theMenu;
    int i = 0;
   /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
   
   
    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
       theMenu = menu;
       new MenuInflater(getApplication()).inflate(R.menu.sample, menu);
       return (super.onCreateOptionsMenu(menu));
    }
//   @Override
//   public boolean onKey(View v, int keyCode, KeyEvent event) {
//      // TODO Auto-generated method stub
//      System.out.println("### onKey");
//      return false;
//   }

}



Thanks
Krishnan
krishnan
Freshman
Freshman
 
Posts: 5
Joined: Fri Apr 23, 2010 3:35 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 28 guests