<legend id='ho8vG'><style id='ho8vG'><dir id='ho8vG'><q id='ho8vG'></q></dir></style></legend>
    <i id='ho8vG'><tr id='ho8vG'><dt id='ho8vG'><q id='ho8vG'><span id='ho8vG'><b id='ho8vG'><form id='ho8vG'><ins id='ho8vG'></ins><ul id='ho8vG'></ul><sub id='ho8vG'></sub></form><legend id='ho8vG'></legend><bdo id='ho8vG'><pre id='ho8vG'><center id='ho8vG'></center></pre></bdo></b><th id='ho8vG'></th></span></q></dt></tr></i><div id='ho8vG'><tfoot id='ho8vG'></tfoot><dl id='ho8vG'><fieldset id='ho8vG'></fieldset></dl></div>

    <small id='ho8vG'></small><noframes id='ho8vG'>

    <tfoot id='ho8vG'></tfoot>

      • <bdo id='ho8vG'></bdo><ul id='ho8vG'></ul>

      android中是否有默认的后退键(在设备上)侦听器?

      时间:2023-08-29
    1. <legend id='df5Gv'><style id='df5Gv'><dir id='df5Gv'><q id='df5Gv'></q></dir></style></legend>
        <tfoot id='df5Gv'></tfoot>

        • <i id='df5Gv'><tr id='df5Gv'><dt id='df5Gv'><q id='df5Gv'><span id='df5Gv'><b id='df5Gv'><form id='df5Gv'><ins id='df5Gv'></ins><ul id='df5Gv'></ul><sub id='df5Gv'></sub></form><legend id='df5Gv'></legend><bdo id='df5Gv'><pre id='df5Gv'><center id='df5Gv'></center></pre></bdo></b><th id='df5Gv'></th></span></q></dt></tr></i><div id='df5Gv'><tfoot id='df5Gv'></tfoot><dl id='df5Gv'><fieldset id='df5Gv'></fieldset></dl></div>

            <small id='df5Gv'></small><noframes id='df5Gv'>

              <tbody id='df5Gv'></tbody>

              <bdo id='df5Gv'></bdo><ul id='df5Gv'></ul>

              • 本文介绍了android中是否有默认的后退键(在设备上)侦听器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有两个活动 A 和 B.当我单击 A 中将显示 B 的按钮时.当我单击 B 中的按钮时,它返回到 A.我在 finish() 方法之后设置了 overridePendingTransition 方法.它工作正常.但如果当前的活动是 B.那时我点击设备中的默认后退按钮.它显示从右到左的过渡以显示 Activity A.

                I am having two activities A and B. when i click the button in A that will shows B. when i click the Button in B it backs to A. i had set the overridePendingTransition method after the finish() method. it works properly. but in case the current Activity is B. on that time i click the default back button in the device. it shows the right to left transition to show the Activity A.

                如何在设备上收听默认返回键?

                How i can listen that Default back key on device?

                Log.v(TAG, "back pressed");
                finish();
                overridePendingTransition(R.anim.slide_top_to_bottom, R.anim.hold);
                

                推荐答案

                @Override
                public boolean onKeyDown(int keyCode, KeyEvent event)  {
                    if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
                        // do something on back.
                        return true;
                    }
                
                    return super.onKeyDown(keyCode, event);
                }
                

                以下链接是Android开发者自己编写的关于如何处理返回键事件的详细说明:

                The following link is a detailed explanation on how to handle back key events, written by the Android developers themselves:

                使用返回键

                这篇关于android中是否有默认的后退键(在设备上)侦听器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:将图片上传到模拟器库 下一篇:如何为三星 Galaxy S4 (1080X1920) 创建 avd

                相关文章

                最新文章

                  <bdo id='imS5d'></bdo><ul id='imS5d'></ul>

                <tfoot id='imS5d'></tfoot>

                1. <i id='imS5d'><tr id='imS5d'><dt id='imS5d'><q id='imS5d'><span id='imS5d'><b id='imS5d'><form id='imS5d'><ins id='imS5d'></ins><ul id='imS5d'></ul><sub id='imS5d'></sub></form><legend id='imS5d'></legend><bdo id='imS5d'><pre id='imS5d'><center id='imS5d'></center></pre></bdo></b><th id='imS5d'></th></span></q></dt></tr></i><div id='imS5d'><tfoot id='imS5d'></tfoot><dl id='imS5d'><fieldset id='imS5d'></fieldset></dl></div>
                2. <small id='imS5d'></small><noframes id='imS5d'>

                3. <legend id='imS5d'><style id='imS5d'><dir id='imS5d'><q id='imS5d'></q></dir></style></legend>