本文整理汇总了Java中android.view.KeyEvent.KEYCODE_BACK属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.KEYCODE_BACK属性的具体用法?Java KeyEvent.KEYCODE_BACK怎么用?Java KeyEvent.KEYCODE_BACK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.KEYCODE_BACK属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (KeyEvent.KEYCODE_BACK == event.getKeyCode()) {
if (fragment != null && !fragment.onBackPressed()) {
if (isFromPush) {
isFromPush = false;
startActivity(new Intent(this, MainActivity.class));
SealAppContext.getInstance().popAllActivity();
} else {
if (fragment.isLocationSharing()) {
fragment.showQuitLocationSharingDialog(this);
return true;
}
if (mConversationType.equals(Conversation.ConversationType.CHATROOM)
|| mConversationType.equals(Conversation.ConversationType.CUSTOMER_SERVICE)) {
SealAppContext.getInstance().popActivity(this);
} else {
SealAppContext.getInstance().popAllActivity();
}
}
}
}
return false;
}
示例2: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent keyEvent) {
if(keyCode == KeyEvent.KEYCODE_BACK) {
Intent i = new Intent(this, Calculator.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
return true;
}
return super.onKeyDown(keyCode, keyEvent);
}
示例3: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (isEdit) {
clearEditMode();
} else if (mNewColumnFieldList == null || mNewColumnFieldList.size() == 0) {
showExitTipDialog();
} else {
finish();
}
return true;
} else {
return super.onKeyDown(keyCode, event);
}
}
示例4: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if ((keyCode == KeyEvent.KEYCODE_BACK))
{ //Back key pressed
//Things to Do
if(player!= null)
{
player.stop();
player=null;
}
finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
示例5: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mWebChromeClient.inCustomView()) {//全屏播放退出全屏
hideCustomView();
return true;
} else if (webView.canGoBack()) {//返回网页上一页
webView.goBack();
return true;
} else {//退出网页
webView.loadUrl("about:blank");
finish();
}
}
return false;
}
示例6: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if(keyCode == KeyEvent.KEYCODE_BACK)
{
return false;
}
return false;
}
示例7: onKeyDown
@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);
}
示例8: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if (keyCode == KeyEvent.KEYCODE_BACK) {
exitEditVideo();
return true;
}
return super.onKeyDown(keyCode, event);
}
示例9: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && contentWebView.canGoBack()) {
contentWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
示例10: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mAmeVoiceInput.isRecording()) {
new CommonDialog(MemoEditActivity.this, "温馨提示", "离开编辑页面前,请先关闭录音识别哦!", "知道了").show();
return true;
}
}
return super.onKeyDown(keyCode, event);
}
示例11: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (KeyEvent.KEYCODE_DPAD_CENTER == keyCode || KeyEvent.KEYCODE_ENTER == keyCode)
{
if (videoList.getVisibility() != View.VISIBLE)
{
videoList.setVisibility(View.VISIBLE);
tips.setVisibility(View.INVISIBLE);
mRecyclerViewBridge.setVisibleWidget(false);
videoList.requestFocus();
}
}
else if (KeyEvent.KEYCODE_BACK == keyCode)
{
if (videoList.getVisibility() == View.VISIBLE)
{
videoList.setVisibility(View.INVISIBLE);
tips.setVisibility(View.VISIBLE);
mRecyclerViewBridge.setVisibleWidget(true);
return true;
}
}
else if (KeyEvent.KEYCODE_MENU == keyCode)
{
if (videoList.getVisibility() != View.VISIBLE)
{
videoList.setVisibility(View.VISIBLE);
tips.setVisibility(View.INVISIBLE);
videoList.requestFocus();
mRecyclerViewBridge.setVisibleWidget(false);
}
}
return super.onKeyDown(keyCode, event);
}
示例12: dispatchKeyEvent
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int keyCode = event.getKeyCode();
if (event.getRepeatCount() == 0
&& (keyCode == KeyEvent.KEYCODE_HEADSETHOOK
|| keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE || keyCode == KeyEvent.KEYCODE_SPACE)) {
doPauseResume();
show(sDefaultTimeout);
if (mPauseButton != null && mTvPlay != null) {
mPauseButton.requestFocus();
mTvPlay.requestFocus();
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP) {
if (mPlayer.isPlaying()) {
mPlayer.pause();
updatePausePlay();
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_BACK
|| keyCode == KeyEvent.KEYCODE_MENU) {
hide();
return true;
} else {
show(sDefaultTimeout);
}
return super.dispatchKeyEvent(event);
}
示例13: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == event.ACTION_DOWN) {
if ((System.currentTimeMillis() - exitTimeMillis) > 2000) {
exitTimeMillis = System.currentTimeMillis();
Snackbar.make(mRecyclerView, "再按一次退出~~", Snackbar.LENGTH_SHORT).show();
} else {
finish();
}
return true;
}
return false;
}
示例14: onKeyDown
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && wvTechContent.canGoBack()) {
wvTechContent.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
示例15: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
ULog.i("KEYCODE_BACK");
}
return super.onKeyDown(keyCode, event);
}