android - Why do I get the wrong shortcut name during installation of my app? -


i published first app android marketplace , noticed if user has setting "add icon home screen" set true in play store app, shortcut gets created during installation has wrong name.

instead of string specified on application label or label on intent filter gets label of activity.

if user manually creates shortcut, naming correct.

here's excerpt androidmanifest.xml:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.dosolves.gym"     android:versioncode="2"     android:versionname="1.1" >     ...      <application         android:name="com.dosolves.gym.app.gymapplication"         android:allowbackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name"         android:theme="@style/apptheme" >          <activity             android:name="com.dosolves.gym.app.category.gui.categoriesactivity"             android:label="@string/categories" >             <intent-filter android:label="@string/app_name" >                 <action android:name="android.intent.action.main" />                  <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>     ...      </application>  </manifest> 

i've seen other questions regarding similar problems e.g.: how set different label launcher rather activity title? problem occurs specified above, both manually created shortcuts , icon in launcher/program menu have correct name.

the desired name shortcuts specified in: @string/app_name , 1 don't want is: @string/categories

any ideas why happens , how can avoid it?

if @ possible avoid solution change title of categories activity app_name , programmatically change title in oncreate i've heard causes app_name displayed short while before programmatically set title displayed.

edit1: tried recreate issue in smallest possible environment created new android project , made necessary changes illustrate issue , published on google play "test app store shortcut". it's can downloaded from: https://play.google.com/store/apps/details?id=com.dosolves.testappstoreshortcutname or searching name "david svedberg". if want recreate issue, sure change settings in play store app on android device automatically create shortcut on home-screen.

the minimum apps manifest in it's entirety:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.dosolves.testappstoreshortcutname"     android:versioncode="1"     android:versionname="1.0" >      <uses-sdk         android:minsdkversion="8"         android:targetsdkversion="18" />      <application         android:allowbackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/right_name"         android:theme="@style/apptheme" >         <activity             android:name="com.dosolves.testappstoreshortcutname.mainactivity"             android:label="@string/wrong_name" >             <intent-filter android:label="@string/right_name">                 <action android:name="android.intent.action.main" />                  <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>     </application>  </manifest> 

and string.xml:

<?xml version="1.0" encoding="utf-8"?> <resources>      <string name="right_name">right name</string>     <string name="action_settings">settings</string>     <string name="hello_world">hello world!</string>     <string name="wrong_name">wrong name</string>  </resources> 

edit2: noticed shortcuts created manually are, said before, given correct name @ first after restart of device wrong name instead.

i encountered same problem , ended setting app name launcher activity label , using settitle set actual activity name. app name not shown short while before activity name if call settitle before super.oncreate , setcontentview. think hacky workaround , wonder why cannot find more issue on web.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -