android.app.Activity.onKeyDown()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(344)

本文整理了Java中android.app.Activity.onKeyDown()方法的一些代码示例,展示了Activity.onKeyDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onKeyDown()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onKeyDown

Activity.onKeyDown介绍

暂无

代码示例

代码示例来源:origin: journeyapps/zxing-android-embedded

@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    return barcodeView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
  }
}

代码示例来源:origin: journeyapps/zxing-android-embedded

@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
  }
}

代码示例来源:origin: journeyapps/zxing-android-embedded

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
}

代码示例来源:origin: rmtheis/android-ocr

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
 if (keyCode == KeyEvent.KEYCODE_BACK) {
  if (webView.canGoBack()) {
   webView.goBack();
   return true;
  }
 }
 return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: novoda/android-demos

return super.onKeyDown(keyCode, event);

代码示例来源:origin: rmtheis/android-ocr

return super.onKeyDown(keyCode, event);

代码示例来源:origin: yuliskov/SmartYouTubeTV

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: Neamar/KISS

@Override
public boolean onKeyDown(int keycode, @NonNull KeyEvent e) {
  if (keycode == KeyEvent.KEYCODE_MENU) {
    // For devices with a physical menu button, we still want to display *our* contextual menu
    menuButton.showContextMenu();
    menuButton.performHapticFeedback(LONG_PRESS);
    return true;
  }
  return super.onKeyDown(keycode, e);
}

代码示例来源:origin: iqiyi/Neptune

@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    // 限制 back 按键,不允许退出
    return keyCode == KeyEvent.KEYCODE_BACK || super.onKeyDown(keyCode, event);
  }
}

代码示例来源:origin: ksvc/KSYMediaPlayer_Android

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    videoPlayEnd();
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: ksvc/KSYMediaPlayer_Android

@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    switch (keyCode) {
      case KeyEvent.KEYCODE_BACK:
        FloatingVideoActivity.this.finish();
        break;
    }
    return super.onKeyDown(keyCode, event);
  }
}

代码示例来源:origin: ksvc/KSYMediaPlayer_Android

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  switch (event.getAction()) {
    case KeyEvent.KEYCODE_BACK:
      FloatingPlayingActivity.this.finish();
      break;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: ksvc/KSYMediaPlayer_Android

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    videoPlayEnd();
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: vanilla-music/vanilla

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
  switch (keyCode) {
  case KeyEvent.KEYCODE_HEADSETHOOK:
  case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
  case KeyEvent.KEYCODE_MEDIA_NEXT:
  case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
    return MediaButtonReceiver.processKey(this, event);
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: google/ringdroid

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_SPACE) {
    onPlay(mStartPos);
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: devinhu/androidone

@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    return getParent().onKeyDown(keyCode, event);
  }
}

代码示例来源:origin: devinhu/androidone

@Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    return getParent().onKeyDown(keyCode, event);
  }
}

代码示例来源:origin: bitstadium/HockeySDK-Android

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    if (LoginManager.listener != null) {
      LoginManager.listener.onBack();
    }
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: threerings/playn

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
 keyHandler.onKeyDown(keyCode, event);
 return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: iqiyi/Neptune

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (getController() != null) {
    return getController().callOnKeyDown(keyCode, event);
  }
  return super.onKeyDown(keyCode, event);
}

相关文章

Activity类方法