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

    <tfoot id='A0Tma'></tfoot>

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

      在小部件单击时将任务置于最前面

      Bring task to front on widget click(在小部件单击时将任务置于最前面)
        <legend id='BchZ7'><style id='BchZ7'><dir id='BchZ7'><q id='BchZ7'></q></dir></style></legend>
          <tbody id='BchZ7'></tbody>

          1. <small id='BchZ7'></small><noframes id='BchZ7'>

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

              <tfoot id='BchZ7'></tfoot>

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

              • 本文介绍了在小部件单击时将任务置于最前面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我发送了一个任务(活动)返回:

                I sent a task (activity) to back with:

                    @Override
                protected void onActivityResult(int requestCode, int resultCode, Intent data) {
                    super.onActivityResult(requestCode, resultCode, data);
                    moveTaskToBack(true);
                }
                

                但我需要通过小部件中的 setOnClickPendingIntent 将其放在前面.

                but I need bring it to front by setOnClickPendingIntent in widget.

                推荐答案

                只需像这样启动应用程序的主(根)活动:

                Just start the main (root) activity of your application like this:

                Intent intent = new Intent(context, MainActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(intent);
                

                如果活动已经在一个任务中运行,这只会将该任务带到前台(不创建活动的任何新实例).如果该 Activity 尚未运行,那么这将启动一个以该 Activity 为根的新任务.

                If the activity is already running in a task, this will just bring that task to the foreground (without creating any new instances of the activity). If the activity is not already running, then this will start a new task with that activity at the root.

                这篇关于在小部件单击时将任务置于最前面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
                cocos2d-android: how to display score(cocos2d-android:如何显示分数)
                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事件)
                  <i id='RVB0P'><tr id='RVB0P'><dt id='RVB0P'><q id='RVB0P'><span id='RVB0P'><b id='RVB0P'><form id='RVB0P'><ins id='RVB0P'></ins><ul id='RVB0P'></ul><sub id='RVB0P'></sub></form><legend id='RVB0P'></legend><bdo id='RVB0P'><pre id='RVB0P'><center id='RVB0P'></center></pre></bdo></b><th id='RVB0P'></th></span></q></dt></tr></i><div id='RVB0P'><tfoot id='RVB0P'></tfoot><dl id='RVB0P'><fieldset id='RVB0P'></fieldset></dl></div>
                1. <small id='RVB0P'></small><noframes id='RVB0P'>

                    <tbody id='RVB0P'></tbody>

                    • <legend id='RVB0P'><style id='RVB0P'><dir id='RVB0P'><q id='RVB0P'></q></dir></style></legend>
                        <tfoot id='RVB0P'></tfoot>
                        • <bdo id='RVB0P'></bdo><ul id='RVB0P'></ul>