diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2010-12-28 00:00:31 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2010-12-28 00:00:31 (GMT) |
commit | edafc81433534a1b3238b1288398013dd5befd7c (patch) | |
tree | c667570dcfc3e7a19c7a1879cb7bf2cbcb8770d0 /src/net | |
parent | 9177502903e884b296878d5ec93e2f8631ae067e (diff) | |
download | SoftKeys-edafc81433534a1b3238b1288398013dd5befd7c.zip SoftKeys-edafc81433534a1b3238b1288398013dd5befd7c.tar.gz SoftKeys-edafc81433534a1b3238b1288398013dd5befd7c.tar.bz2 |
Add real menu so people may see "help" quicker instead of digging in the
prefs
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/hoopajoo/android/SoftKeys/Keys.java | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/net/hoopajoo/android/SoftKeys/Keys.java b/src/net/hoopajoo/android/SoftKeys/Keys.java index 2724451..3a30985 100644 --- a/src/net/hoopajoo/android/SoftKeys/Keys.java +++ b/src/net/hoopajoo/android/SoftKeys/Keys.java @@ -40,6 +40,9 @@ import android.os.Handler; import android.preference.PreferenceManager; import android.util.Log; import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; @@ -374,7 +377,31 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen } } - + @Override + public boolean onCreateOptionsMenu( Menu menu ) { + getMenuInflater().inflate( R.menu.main, menu ); + return true; + } + + @Override + public boolean onOptionsItemSelected( MenuItem item ) { + // Handle item selection + switch( item.getItemId() ) { + case R.id.menu_help: + Intent intent = new Intent( this, QuickDoc.class ); + intent.putExtra( "type", "help" ); + startActivity( intent ); + return true; + + case R.id.menu_settings: + generic_click( R.id.settings, false ); + return true; + + default: + return super.onOptionsItemSelected( item ); + } + } + @Override public void onNewIntent( Intent i ) { Globals app = (Globals)getApplication(); @@ -641,10 +668,12 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen @Override public boolean onKeyDown( int code, KeyEvent k ) { + /* let menu be menu if( code == KeyEvent.KEYCODE_MENU ) { generic_click( R.id.settings, false ); return true; } + */ return super.onKeyDown( code, k ); } |