I am working on game menu (android.view.Menu;), actual start game menu is done using .png+drawbitmap+drawrect etc etc....but for end game, restart game n other settings m using android.view.Menu;
wen activity starts n main game menu gets displayed which is on view.....if click menu button 1st widout pressing ne other key den menu pops up ...but if ne other key was pressed b4 menu button den menu does not pops-up.....
if i call it explicitly in onKeyDown() then menu pops-up and when release menu button then it goes down.
can ne1 guess wat might be da prob?? javascriptemoticon(':?:')
thanx in advance..........
package com.sv;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
/**
* Implements the main application class.
*/
public class ASDF extends Activity implements Commands {
private static MainWindow mWindow;
public static final int Quit_id = Menu.FIRST;
private static int temp1;
static boolean first = false;
static Intent i;
@Override
public synchronized void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(0); // for landscape mode
mWindow = new MainWindow(this, this); //view where game starts
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(mWindow);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
Log.d("onCreateOptionsMenu", "onCreateOptionsMenu");
menu.add(0, Quit_id, 0, null).setShortcut('0', 'r').setIcon(
android.R.drawable.ic_menu_close_clear_cancel);
Log.d("onCreateOptionsMenu11", "onCreateOptionsMenu1111111");
return true;
// return super.onCreateOptionsMenu(menu);
}
//
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId()) {
case Quit_id:
quit();
}
return super.onOptionsItemSelected(item);
}
public void openMenu() { //for calling menu explicitly same as openOptionMenu();
this.getWindow().openPanel(Window.FEATURE_OPTIONS_PANEL,
new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_MENU));
}
}



