android-intentgoogle-searchandroid-tv

How to open google search keyboard using intent (Android TV)?


I want to open Google keyboard search layout on my Android TV app, as it is provided by the default android launcher. Shown in the picture given below.

enter image description here

On clicking this button it opens the page given below.

enter image description here

I want to know what are the intent parameters to open this activity on Android TV via my app. I also get this log in my system logcat when I click this button.

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: My app is user app and doesn't have any root privileges.
Edit 1:
After using the following intent

  Intent intent = new Intent();
  intent.setComponent(new ComponentName("com.google.android.katniss", "com.google.android.katniss.search.KeyboardSearchActivity"));

I get this error

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 

Solution

  • not exported So in AndroidManifest.xml this activity set android:exported="false" So that only root privileges can start this.