I have my application named Umall but it is replaced by Slash that is my First Activity i am stuck with that small problem don't know how to handle it.. i gave application name directly in application lable
My Manifest.XML is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ef.umall"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/app_logo"
android:label="Umall"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="" >
</activity>
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.HomeActivity"
android:label="#string/title_activity_home" >
</activity>
<activity
android:name=".activity.ProductsListActivity_"
android:label="#string/title_activity_products_list" >
</activity>
<activity
android:name=".activity.ProductDetail_"
android:label="#string/title_activity_product_detail" >
</activity>
<activity
android:name=".activity.CartActivity_"
android:label="#string/title_activity_cart" >
</activity>
<activity
android:name=".activity.ProductActivity_"
android:label="#string/title_activity_product" >
</activity>
<activity
android:name=".activity.UmallBaseActivity_"
android:label="#string/title_activity_umall_base" >
</activity>
<activity
android:name=".activity.ShopingChart"
android:label="#string/title_activity_shoping_chart" >
</activity>
</application>
</manifest>
Try to define the application name in your string.xml file and then replace this line :
<application
android:allowBackup="true"
android:icon="#drawable/app_logo"
android:label="#string/appname"
android:theme="#style/AppTheme" >
Where "appname" is a string in string.xml like :
<string name="appname">Umall</string>
can have a label attribute. If it's absent the label is inherited from the parent component (either Activity or Application). So using this, you can set a label for the launcher icon, while still having the Activity with it's own title.
so change this
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
to this
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter android:label="Umall">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
better to use #string/app_name
more info here
Related
After the update, the following warning appeared in the studio:
“App is not indexable by Google Search; consider adding ACTION-VIEW intent filter. See issue explanation for more details. more ... (Ctrl + F1) »
How to fix it?
My Api is 28.
Here is my manifests:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.omen.serverforcofe" >
<uses-permission android:name="android.permission.NFC"/>
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain"
/>
</intent-filter>
</activity>
</application>
</manifest>
<activity
android:name=".MyActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
Adding this intent filter to one of the activities declared in app manifest fixed this for me.
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>
In my manifest. with the new SDK, it requires me to replace my android:name paths with the warning:
use $ instead of . for inner classes(or use only lowercase letters in package name)
This is one of my activities:
<activity
android:name=".Activities.LoginActivity" >
</activity>
and it suggest me to replace it with
<activity
android:name=".Activities$LoginActivity" >
</activity>
The problem is that this produce the following:
Cannot resolve symble Activities
So, what I have to do? I just ignore the alert or I have to replace it someway else?
EDIT:
here is the source of activities folder:
app.java.personal.pier.myapp.Activities
this is my entire manifest, I don't think it should be need but just in case it is here :)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="personal.pier.myapp" >
<uses-permission android:name="andorid.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:supportsRtl="true" >
<activity
android:name=".Activities.SplashScreenActivity"
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=".Activities.LoginActivity" >
</activity>
<activity
android:name=".Activities.HomePageActivity" >
</activity>
<activity
android:name=".Activities.FoodAddActivity" >
</activity>
<activity
android:name=".Activities.FoodManagementActivity" >
</activity>
<activity
android:name=".Activities.FoodDetailsActivity" >
</activity>
<activity
android:name=".Activities.EatingSuntActivity" >
</activity>
<activity
android:name=".Activities.EatingDetailsActivity" >
</activity>
<activity
android:name=".Activities.EatingAddActivity" >
</activity>
<activity android:name=".Activities.SportAddActivity" >
</activity>
</application>
</manifest>
The most likely problem appeared because you are using upper case in your package name.
I'am making apps for android using eclipse but suddenly when I was using the emulator the apps stopped appearing on my home screen and when I check in the Application manager they are installed but I can't access them and I tried installing the app on my android phone and the same thing also happened so any clue how to fix this, that would be great. thanks
edit:
The app starts correctly when I launch it from eclipse but the icon won't appear on my home screen so I can't access it
here is my mainfest code:
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="18" />
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.Moon.khwallpaper.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.Moon.khwallpaper.Menu"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MENU" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.Moon.khwallpaper.SET2"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.SET2" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Try removing the intent-filter of your MainActivity and changing the Menu intent-filter to:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
EDIT:
Your logcat suggests that you are trying to start an activity with an action that is not set (or set incorrectly).
It's looking for the action com.Moon.khwallpaper.SET2 while what you have set is com.example.wallpaper.SET2.
I believe changing the latter to the former should work.
try this
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="18" />
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.wallpaper.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="com.example.wallpaper.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.wallpaper.Menu"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.example.wallpaper.SET2"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
</application>
</manifest>
Android-Installing to device using eclipse install two instance of same app at once-error
and it runs when just after installed using the eclipse but when I touch the once of the icon its not starting it shows me the android common error syaing unexpectedly stopped!! please help me??
This is the manifest I'm using(activities)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hunter99x"
android:icon="#drawable/icon"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".main" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
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>
<activity android:name=".origine" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.origine" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity `enter code here`android:name=".Gameover" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
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>
<activity android:name=".LandingScreen" android:configChanges="orientation|keyboardHidden" android:theme="#android:style/Theme.NoTitleBar"
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>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
I think the issue is because you have repeated
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
this for 2 activities. Try removing this and declare just 1 acivity as your main. Tjis may solve your issue.
Try this code inside the activities and check if it works:
#Override
public void onBackPressed() {
finish();
System.exit(0);
}