问题描述
我想在我的Android TV应用程序上打开Google键盘搜索布局,因为它是默认android启动器提供的。如下图所示。
单击此按钮将打开以下页面。
我想知道通过我的应用在Android TV上打开此活动的意图参数是什么。单击此按钮时,也会在系统日志中显示此日志。
system_process I/ActivityManager: START u0 {act=android.intent.action.ASSIST flg=0x10a00000 cmp=com.google.android.katniss/.search.KeyboardSearchActivity (has extras)} from uid 10028
PS:我的应用程序是用户应用程序,没有任何root特权。
编辑1:
使用以下意图
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.google.android.katniss","com.google.android.katniss.search.KeyboardSearchActivity"));
我收到此错误
W/ActivityManager: Permission Denial: starting Intent { cmp=com.google.android.katniss/.search.KeyboardSearchActivity } from ProcessRecord{4ff6631 14881:com.basic.android.basiclauncher/u0a55} (pid=14881,uid=10055) not exported from uid 10028
E/InputEventSender: Exception dispatching finished signal.
E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI: java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.google.android.katniss/.search.KeyboardSearchActivity } from ProcessRecord{4ff6631 14881:com.basic.android.basiclauncher/u0a55} (pid=14881,uid=10055) not exported from uid 10028
解决方法
urlA
因此,在not exported
中,此活动集AndroidManifest.xml
这样只有root特权才能启动此操作。