I have created a new Android app (in Android Studio). It builds fine, installs successfully, but then doesn't actually open.
When I go to open the app manually, there is no open button at all! This is the case for both virtual and physical devices.
The app appears in the app list in the settings, but no icon is created in the list of apps the user sees.
Why is this happening? I have attached my manifest file and my home activity, let me know if you need anything else.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ProjectBiplane"
tools:targetApi="32">
<activity
android:name=".ui.activities.Home"
android:exported="false" />
</application>
</manifest>
Home.java
package com.example.projectbiplane.ui.activities;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.projectbiplane.R;
public class Home extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
}
CodePudding user response:
Your activity still needs a Launch Activity intent filter (and it needs to be exported):
<activity
android:name=".ui.activities.Home"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>