android穿编程调出app laucher

时间:2018-05-12 12:23:03

标签: android wear-os android-wear-2.0

我的Ticwatch E左侧有一个物理按钮。 当我穿着一件长衬衫时,我发现这很难尴尬。 伸展手臂以露出表盘和表面。触摸/滑动更容易。 所以,我试图添加相当于"物理按钮按下"对我的表盘采取行动。 这些代码行提供了一系列应用程序,但列表非常有限。

                Intent startMain = new Intent(Intent.ACTION_MAIN);
                startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                if (startMain.resolveActivity(getPackageManager()) != null) {
                    startActivity(startMain);
                }

我真的很想打开按下物理按钮时显示的原生应用启动器。 当我按下物理按钮时,Logcat会报告此活动信息。

      I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.google.android.wearable.app/com.google.android.clockwork.home2.activity.HomeActivity2 (has extras)} from uid 1000 on display 0

有什么想法吗? 哦,手势不能奏效。在Ticwatch上,手势只允许您在卡片之间切换。 (显然)用于调出应用程序启动器的上/下写入动作不起作用。

0 个答案:

没有答案
相关问题