title: Android TV not starting LAUNCH_LEANBACK Activity
body: <p>I want to create a single apk that will be compatible with mobile and TV. As I understand I should specify the launcher activity for both platforms in manifest, one for mobile with <code>&lt;category android:name="android.intent.category.LAUNCHER" /&gt;</code>, another for TV with  <code>&lt;category android:name="android.intent.category.LEANBACK_LAUNCHER" /&gt;</code> <code>intent filter</code>. And Android should automatically pick the right activity when launching, depending on platform, right ? Or I should add some java code and start my TV activity from code ? Currently it launch my mobile activity when using android TV emulator. Below is my manifest file :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      package="com.mypackagename"
      android:versionCode="142"
      android:versionName="2.0.142" &gt;
  
      &lt;uses-sdk tools:overrideLibrary="android.support.v17.leanback"/&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
      &lt;uses-feature
          android:name="android.hardware.microphone"
          android:required="false" /&gt;
  
      &lt;uses-feature
          android:name="android.hardware.bluetooth"
          android:required="false" /&gt;
  
      &lt;!-- TV --&gt;
      &lt;uses-feature
          android:name="android.hardware.touchscreen"
          android:required="false" /&gt;
  
      &lt;uses-feature android:name="android.software.leanback"
          android:required="false" /&gt;
  
      &lt;application
          android:name="com.mypackagename.App"
          android:allowBackup="true"
          android:hardwareAccelerated="true"
          android:icon="@drawable/ic_launcher"
          tools:replace="android:icon"
          android:label="@string/app_name"
          android:banner="@drawable/ic_launcher"
          android:largeHeap="true"
          android:supportsRtl="false"
          android:theme="@style/AppTheme" &gt;
  
          &lt;activity
              android:name="com.mypackagenametv.MainTVActivity"
              android:theme="@style/TVAppTheme"
              android:label="@string/app_name"
              android:logo="@drawable/ic_launcher"
              android:screenOrientation="landscape" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LEANBACK_LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mypackagenametv.PlayerActivity"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /&gt;
          &lt;activity android:name="com.mypackagenametv.DetailsActivity" /&gt;
  
          &lt;meta-data
              android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" /&gt;
  
          &lt;activity
              android:name="com.mypackagename.ui.activities.MainActivity"
              android:label="@string/app_name"
              android:launchMode="singleTask"
              android:screenOrientation="sensorLandscape"
              android:windowSoftInputMode="stateHidden|adjustResize|adjustPan" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.VIEW" /&gt;
  
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
                  &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mypackagename.ui.activities.SplashActivity"
              android:configChanges="keyboardHidden|orientation|screenSize"
              android:label="@string/app_name"
              android:screenOrientation="sensorLandscape"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
   .... other activities
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>SOLVED</strong></p>
  
  <p>My mobile activity was specified explicitly in <a href="https://i.stack.imgur.com/L2JdA.jpg" rel="nofollow noreferrer"><em>Run configurations</em></a> as launcher. After I set <em>Launch default Activity</em> everything works fine.</p>