• <bdo id='28Y0o'></bdo><ul id='28Y0o'></ul>

  • <small id='28Y0o'></small><noframes id='28Y0o'>

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

        <legend id='28Y0o'><style id='28Y0o'><dir id='28Y0o'><q id='28Y0o'></q></dir></style></legend>
      1. Intent 启动新 Activity 的速度非常慢 :(

        Intent is very slow to launch a new Activity :((Intent 启动新 Activity 的速度非常慢 :()
      2. <i id='0Bg1W'><tr id='0Bg1W'><dt id='0Bg1W'><q id='0Bg1W'><span id='0Bg1W'><b id='0Bg1W'><form id='0Bg1W'><ins id='0Bg1W'></ins><ul id='0Bg1W'></ul><sub id='0Bg1W'></sub></form><legend id='0Bg1W'></legend><bdo id='0Bg1W'><pre id='0Bg1W'><center id='0Bg1W'></center></pre></bdo></b><th id='0Bg1W'></th></span></q></dt></tr></i><div id='0Bg1W'><tfoot id='0Bg1W'></tfoot><dl id='0Bg1W'><fieldset id='0Bg1W'></fieldset></dl></div>
          <bdo id='0Bg1W'></bdo><ul id='0Bg1W'></ul>
            <tbody id='0Bg1W'></tbody>
        • <small id='0Bg1W'></small><noframes id='0Bg1W'>

                1. <legend id='0Bg1W'><style id='0Bg1W'><dir id='0Bg1W'><q id='0Bg1W'></q></dir></style></legend>

                2. <tfoot id='0Bg1W'></tfoot>
                  本文介绍了Intent 启动新 Activity 的速度非常慢 :(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一段 Intent 代码:

                  I have this piece of code for an Intent:

                  Intent i = new Intent();
                          i.setAction(Intent.ACTION_MAIN);
                          i.addCategory(Intent.CATEGORY_LAUNCHER);
                          i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                                  | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                          i.setComponent(new ComponentName(packToLaunch, nameToLaunch));
                          startActivity(i);
                  

                  这基本上会根据我传递给它的包名称启动一个新活动.有时,启动此新活动最多需要 5 秒钟.有没有办法加快这个过程?当我有一个仍在运行的应用程序时,甚至需要这么长时间.请帮忙...

                  This basically launches a new activity based on the package name that I pass to it. Sometimes, it takes up to 5 seconds to launch this new Activity. Is there any way to speed this process up? It even takes this long when I have an app that is still running. Please help...

                  推荐答案

                  Android 似乎故意延迟了服务中 Activity 的启动在您按下 HOME 按钮后.(使用 BACK 按钮时一切正常.)甚至发布了问题 https://code.google.com/p/android/issues/detail?id=4536 但是它已经过时了.

                  It looks like Android intentionally delays launch of activity from service right after you press HOME button. (When using BACK button everything is OK.) There was even issue posted https://code.google.com/p/android/issues/detail?id=4536 however it got obsolete.

                  我试图在 Android 源代码中搜索延迟的实际实现,但失败了.您可能需要检查以下问题,因为它说明了完全相同的问题并提供了更多见解:在按下 HOME 按钮后从服务开始活动,没有 5 秒延迟

                  I tried to search actual implementation of the delay in Android source, but failed. You might want to check the following question as it states pretty same issue and gives some more insights: Starting an activity from a service after HOME button pressed without the 5 seconds delay

                  这篇关于Intent 启动新 Activity 的速度非常慢 :(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
                  SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
                  Android file copy(安卓文件拷贝)
                  Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)
                  Android copy image from gallery folder onto SD Card alternative folder(Android将图像从图库文件夹复制到SD卡替代文件夹)
                  Is there a tool to find unused resources in an Android project?(是否有工具可以在 Android 项目中查找未使用的资源?)
                  1. <small id='fhGIY'></small><noframes id='fhGIY'>

                  2. <tfoot id='fhGIY'></tfoot>
                      <bdo id='fhGIY'></bdo><ul id='fhGIY'></ul>

                            <tbody id='fhGIY'></tbody>

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