The default back button that appears next to the icon in the action bar crashes when i try to return to MainActivity. MainActivity calls DisplayMessageActivity from there I click the default back button and the app crashes.
Logs show message:
E/AndroidRuntime(24509): java.lang.IllegalArgumentException: Activity DisplayMessageActivity does not have a parent activity name specified. (Did you forget to add the android.support.PARENT_ACTIVITY <meta-data> element in your manifest?)
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.assemblyx.playzone"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="net.assemblyx.playzone.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="net.assemblyx.playzone.DisplayMessageActivity"
android:label="#string/title_activity_display_message"
android:parentActivityName="net.assemblyx.playZone.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="net.assemblyx.playZone.MainActivity" />
</activity>
</application>
package name had playZone and should have been playzone
Related
So, I tried to change the package by the following steps I found elsewhere on StackOverflow website:
create a new package
refractor the package to the new package
changing the package line in the form for the AndroidManifest.xml
btw I'm using Eclipse, if that's relevant.
However, I'm getting an error message in the AndroidManifext.xml file:
Parser exception for /GameProj/AndroidManifest.xml: The prefix "com.p.gameproj.Dataid" for attribute "com.p.gameproj.Dataid:name" associated with an element type "activity" is not bound At line 31.
Can someone tell me what the error message means?
Also, here's the AndroidManifest.xml file, if it's relevant:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.p.gameproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.p.gameproj.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
com.p.gameproj.Creditsname=".Credits"
android:label="#string/title_activity_credits" >
</activity>
<activity
com.p.gameproj.Dataid:name=".Data"
android:label="#string/title_activity_data" >
</activity>
<activitycom.p.gameproj.CharacterPageandroid:name=".CharacterPage"
android:label="#string/title_activity_character_page" >
</activity>
<activity
com.p.gameproj.StatPageame=".StatPage"
android:label="#string/title_activity_stat_page" >
</activity>
<activitycom.p.gameproj.MapMain android:name=".MapMain"
android:label="#string/title_activity_map_main" >
</activity>
com.p.gameproj.ScreenLocvity
android:name=".ScreenLoc"
android:label="#string/title_activity_screen_loc"com.p.gameproj.BattleScreen/activity>
<activity
android:name=".BattleScreen"
android:label="#string/title_activity_battle_screen" >
</com.p.gameproj.InvScreen
<activity
android:name=".InvScreen"
android:label="#string/title_activity_inv_screen"com.p.gameproj.ShopThing </activity>
<activity
android:name=".ShopThing"
android:label="#string/title_activity_shop_thing" >
</activity>
</application>
</manifest>
Looks like something went wrong during your package name change. Probably a bad find/replace action. There are a several invalid attributes and elements in the AndroidManifest.xml file such as the following:
<activity
com.p.gameproj.Dataid:name=".Data"
android:label="#string/title_activity_data" >
Notice the com.p.gameproj.Dataid:name=".Data". It should be android:name=".Data".
Once you fix all these bad values it should work again.
This should be close
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.p.gameproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.p.gameproj.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Credits"
android:label="#string/title_activity_credits" >
</activity>
<activity
android:name=".Data"
android:label="#string/title_activity_data" >
</activity>
<activity
android:name=".CharacterPage"
android:label="#string/title_activity_character_page" >
</activity>
<activity
android:name=".StatPage"
android:label="#string/title_activity_stat_page" >
</activity>
<activity
android:name=".MapMain"
android:label="#string/title_activity_map_main" >
</activity>
<activity
android:name=".ScreenLoc"
android:label="#string/title_activity_screen_loc">
</activity>
<activity
android:name=".BattleScreen"
android:label="#string/title_activity_battle_screen" >
</activity>
<activity
android:name=".InvScreen"
android:label="#string/title_activity_inv_screen">
</activity>
<activity
android:name=".ShopThing"
android:label="#string/title_activity_shop_thing" >
</activity>
</application>
</manifest>
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.semesterproject"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.SEND_SMS"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:windowSoftInputMode="adjustResize|adjustPan"
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The error is shown at the start of activity tag.
I changed the android:theme in the application to fullscreen then the error was generated, I did undo the changes i-e change the them to the previous theme that is shown in the code but it's still giving the error. What is causing the error, and how can I fix it?
when I update my SDK the icon app doesn't appear in the activities I tried all the solution on the internet but nothing happened .. I tried also to put " android:icon" in each activities nothing change also made a custom actionbar also nothing change .. please any help?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=""
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0" >
"
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/CustomActionBarTheme" >
<activity
android:name=".Main"
android:label="#string/app_name"
android:theme="#style/NoActionBarTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Option"
android:label="#string/title_activity_option" >
</activity>
<activity
android:name=".CustomList"
android:label="#string/title_activity_custom_list" >
</activity>
<activity
android:name=".Social"
android:label="#string/title_activity_social" >
</activity>
<activity
android:name=".About"
android:label="#string/title_activity_about" >
</activity>
<activity
android:name=".ActionBar"
android:label="#string/title_activity_action_bar" >
</activity>
</application>
</manifest>
I need a hand with the Android Manifest file.
I have 4 java files called: MainActivity, Splash, TextPlay and Menu. I want the Splash file to be displayed first. (I have it set for 5 seconds)
I then want the Menu to be displayed(I have the rest of the files displayed on Menu page.)
The app also wont debug on the emulator and im guessing its the manifests fault.
Can someone help me achieve this, Thanks!!
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.intigerdev.numberapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.intigerdev.numberapp.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MENU" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".TextPlay"
android:label="#string/app_name" >
</activity>
</application>
</manifest>
You will have to move between activities on your own. The manifest doesn't do that for you.. if you want your app to start on the Splash screen use this manifest instead:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.intigerdev.numberapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Menu"
android:label="#string/app_name"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"/>
<activity
android:name=".TextPlay"
android:label="#string/app_name"/>
</application>
</manifest>
OnCreate of the Splash activity (stackoverflow.com/a/6489385/736496):
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
finish();
Intent intent = new Intent(Splash.this, Menu.class);
startActivity(intent);
}
}, 5000);
}
The title explains it pretty much, here is the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.craym.vulcrum.firstgametnb"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".StartingPoint"
android:label="#string/app_name" >
<intent-filter>
<action android:name="eu.craym.vulcrum.STARTINGPOINT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Yet whenever I run this application, the StartingPoint classed is called first:
[2013-03-09 18:36:40 - FirstGameTNB] Starting activity eu.craym.vulcrum.firstgametnb.StartingPoint on device emulator-5554
Why is this happening? I thought the MAIN and LAUNCHER were supposed to make it so the Splash class gets called first, but this never happens. Note that when I delete the StartingPoint activity, it goes to Splash.
You're right. You may try a clean on your project.
android.intent.action.MAIN: Start as a main entry point, does not
expect to receive data.
Source