本文整理匯總了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);
}