Reputation: 2137
I have created an simple app with a few activities. After successful installation I can't open the app. I can just see it in device's apps.
Yes of course a read all the answers telling "You have to set launcher activity". But I set launcher activity.
Here is AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme">
</application>
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.SearchActivity"
android:label="@string/search_activity">
</activity>
<activity
android:name=".activities.CustomerActivity"
android:label="@string/customer_activity">
</activity>
<activity
android:name=".activities.CreditActivity"
android:label="@string/credit_activity">
</activity>
<activity
android:name=".activities.PrintReceiptActivity"
android:label="@string/print_receipt_activity">
</activity>
<activity
android:name=".activities.ProductActivity"
android:label="@string/product_activity">
</activity>
Never before happened to me... Can you give me some advice? Thanks a lot
Upvotes: 0
Views: 86
Reputation: 1201
Change your AndroidManifest.xml structure to -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme">
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.SearchActivity"
android:label="@string/search_activity">
</activity>
<activity
android:name=".activities.CustomerActivity"
android:label="@string/customer_activity">
</activity>
<activity
android:name=".activities.CreditActivity"
android:label="@string/credit_activity">
</activity>
<activity
android:name=".activities.PrintReceiptActivity"
android:label="@string/print_receipt_activity">
</activity>
<activity
android:name=".activities.ProductActivity"
android:label="@string/product_activity">
</activity>
</application>
</manifest>
All activities tag must be placed inside <application>
tag and it should be placed inside <manifest>
tag.
Upvotes: 0
Reputation: 21
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme">
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.SearchActivity"
android:label="@string/search_activity">
</activity>
<activity
android:name=".activities.CustomerActivity"
android:label="@string/customer_activity">
</activity>
<activity
android:name=".activities.CreditActivity"
android:label="@string/credit_activity">
</activity>
<activity
android:name=".activities.PrintReceiptActivity"
android:label="@string/print_receipt_activity">
</activity>
<activity
android:name=".activities.ProductActivity"
android:label="@string/product_activity">
</activity>
</application>
</manifest>
try Replacing your manifest with this..
Upvotes: 0
Reputation: 12963
Your manifest should look like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme">
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
...
...
</application>
</manifest>
Upvotes: 0
Reputation: 21805
All your activities are required to be defined within the <application>
tag.
<application
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme">
<!-- Add activites here -->
</application>
Upvotes: 2