Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do i override the Live TV player being the default handler of an Intent set to the action ACTION_VIEW?
    text
    copied!<p>I am trying to follow along here. I have just starting learning to work with channels on GoogleTV.</p> <p><a href="https://developers.google.com/tv/android/docs/gtv_channelchanging" rel="nofollow">https://developers.google.com/tv/android/docs/gtv_channelchanging</a></p> <p>This doc says...</p> <p>*Any Google TV Android application can change the TV channel programmatically. To do this, the app calls startActivity() with an Android Intent object set to the action ACTION_VIEW. Any Google TV Android application can change the TV channel programmatically...Notice that this Intent does not specify a component name, By default, this Intent is handled by the Live TV player, which is part of the Google TV platform. If you want, you can declare an intent filter for this Intent in your Google TV application's manifest (AndroidManifest.xml). You can then offer your application as an alternative for handling the Intent.*</p> <p>I am trying to do this. I want to intercept the channel change when the user types the channel (a number) into their gtv remote, do something with that channel number data, and then let the Live Player change the channel. I was hoping that an activity that was set with an intent-filter action of ACTION_VIEW would catch the channel change when the user types into the remote.</p> <pre><code>&lt;activity android:name="com.xxx.ActionViewActivity"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.ACTION_VIEW" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>Then, the ActionViewActivity.java:</p> <pre><code>public class ActionViewActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = getIntent(); Log.i(getClass().getName(), intent.getAction()); } } </code></pre> <p>It never makes it to the onCreate method. What am i missing here?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload