Getting “Default activity not found” even though setting correct intent filters


Getting “Default activity not found” even though setting correct intent filters



I'm trying to change my default activity in Android Studio. I have added the MAIN and LAUNCHER intent tags to VrMainActivity, removed the MAIN and LAUNCHER tags from MainActivity and still get a "Default Activity not found" error. I have also invalidated cache/restarted. Also no errors in the Merged Manifest section of the editor, totally stuck on what the problem is.



Here's my manifest file:


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thanics.andrew.halocontrol">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

<uses-feature
android:name="android.hardware.vr.headtracking"
android:required="false"
android:version="1" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-feature
android:name="android.software.vr.mode"
android:required="false" />
<uses-feature
android:name="android.hardware.vr.high_performance"
android:required="false" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<!-- Make accelerometer and gyroscope hard requirements for good head tracking. -->
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true"/>
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="true"/>


<application
android:allowBackup="true"
android:icon="@mipmap/halo_drone_app_icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/halo_drone_app_icon_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
>
<activity
android:name=".VrMainActivity"
android:screenOrientation="landscape"
android:configChanges="density|keyboardHidden|navigation|orientation|screenSize|uiMode"
android:enableVrMode="@string/gvr_vr_mode_component"
android:resizeableActivity="false"
android:theme="@style/VrActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.google.intent.category.LAUNCHER" />

<!--<category android:name="com.google.intent.category.CARDBOARD" />-->
<category android:name="com.google.intent.category.DAYDREAM" />
</intent-filter>

<!-- The VR icon to be used in Daydream Home comes in two parts:
a foreground icon and a background icon. -->
<meta-data android:name="com.google.android.vr.icon"
android:resource="@mipmap/halo_drone_app_icon" />
<meta-data android:name="com.google.android.vr.icon_background"
android:resource="@mipmap/halo_drone_app_icon" />

</activity>
<activity
android:name=".MainActivity">
</activity>
<activity
android:name=".StereoFlightActivity"
android:screenOrientation="landscape">

</activity>

</application>

</manifest>




2 Answers
2



you need to use <category android:name="android.intent.category.LAUNCHER" /> to make any
activity as launcher .


<category android:name="android.intent.category.LAUNCHER" />



Just replace <category android:name="com.google.intent.category.LAUNCHER" /> to <category android:name="android.intent.category.LAUNCHER" /> inside your Manifest.


<category android:name="com.google.intent.category.LAUNCHER" />


<category android:name="android.intent.category.LAUNCHER" />





Thanks! Not sure how the google part got in there...
– Andrew Loomis
Jul 2 at 14:00





its alright , hope it helped you buddy :)
– Thunder
Jul 2 at 17:29



try to add this line:


<category android:name="android.intent.category.DEFAULT" />



in the <intent-filter> tag


<intent-filter>






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

Display dokan vendor name on Woocommerce single product pages