Beispiel #1
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   int id = item.getItemId();
   if (id == R.id.script_help) {
     Help.show(this);
   } else if (id == R.id.script_example) {
     InstallExampleDialog installExampleDialog =
         new InstallExampleDialog(this, this, new AlertDialog.Builder(this));
     installExampleDialog.setDestPath(mBaseDir.getAbsolutePath());
     installExampleDialog.start(); // 解压例子
   } else if (id == R.id.script_about) {
     startActivity(new Intent(this, AboutActivity.class));
   } else if (id == R.id.script_interpreters) {
     // Show interpreter manger.
     startActivity(new Intent(this, InterpreterManager.class));
   } else if (id == R.id.script_preferences) {
     startActivity(new Intent(this, Preferences.class));
   } else if (id == R.id.script_triggers) {
     startActivity(new Intent(this, TriggerManager.class));
   } else if (id == R.id.script_logcat) {
     startActivity(new Intent(this, LogcatViewer.class));
   } else if (id == R.id.script_refresh) {
     updateAndFilterScriptList(mQuery);
     mAdapter.notifyDataSetChanged();
   }
   return true;
 }
Beispiel #2
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   int itemId = item.getItemId();
   if (itemId == MenuId.HELP.getId()) {
     Help.show(this);
   } else if (itemId == MenuId.PREFERENCES.getId()) {
     startActivity(new Intent(this, Preferences.class));
   } else if (itemId != Menu.NONE) {
     Intent intent = new Intent(this, ScriptPicker.class);
     intent.setAction(Intent.ACTION_PICK);
     startActivityForResult(intent, itemId);
   }
   return true;
 }