Tabnine Logo
ActivityGroup.onKeyDown
Code IndexAdd Tabnine to your IDE (free)

How to use
onKeyDown
method
in
android.app.ActivityGroup

Best Java code snippets using android.app.ActivityGroup.onKeyDown (Showing top 2 results out of 315)

origin: baidu/GPT

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  Activity target = getCurrentActivity();
  if (target != null) {
    return target.onKeyDown(keyCode, event);
  } else {
    return super.onKeyDown(keyCode, event);
  }
}
origin: devinhu/androidone

  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if(keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){
      MessageDialog dialog = new MessageDialog(MainActivity.this,
          getString(R.string.common_title_tips),
          getString(R.string.common_confirm),
          getString(R.string.common_cancel),
          getString(R.string.common_exit));
      dialog.setBtn1ClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
          LruCacheManager.getInstance().evictAll();
          ActivityPageManager.getInstance().exit(MainActivity.this);
        }
      });
      dialog.show();
      return true;
    }
    return super.onKeyDown(keyCode, event);
  }
}
android.appActivityGrouponKeyDown

Popular methods of ActivityGroup

  • onCreate
  • getCurrentActivity
  • onDestroy
  • getLocalActivityManager
  • <init>
  • attachBaseContext
  • findViewById
  • finish
  • finishAffinity
  • getApplicationContext
  • getAssets
  • getClassLoader
  • getAssets,
  • getClassLoader,
  • getIntent,
  • getResources,
  • getSystemService,
  • getTheme,
  • onApplyThemeResource,
  • onContentChanged,
  • onKeyUp

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • JOptionPane (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now