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.
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:
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;
// }
}