I have installed the Android App on which I am currently working on my ASUS tablet, running 4.0.3
However, I must have accidentally deleted something in the Manifest.xml, because there is no words below the app icon. In other words, the app name is not appearing below the app icon on my device, and, as such, it is sorted in the All Apps screen in the wrong place.
Here is the relevant section of my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tra.games.mytaboo"
android:versionCode="1"
android:versionName="1.2.1" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="Taboo"
android:theme="#style/AppTheme" >
.....
What am I missing?
Tim, Label of your launcher activity will be displayed.
<activity
android:label="Taboo"
android:icon="#drawable/icon"
android:name=".activity.LaunchrActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
http://developer.android.com/guide/topics/manifest/activity-element.html#label
<activity
android:label="Your Name" <---- here name!
android:icon="#drawable/icon"
android:name=".activity.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
You could call the setTitle() function from within your Activity. It takes either an int (resource ID) or a CharSequence as a parameter.
You have missed android:label property. which is set your application name under the icon
android:label="#string/app_name"
Here I have set to load app name from string.xml file.
You can set it directly like this too
android:label="app name"
Related
this problem is confusing me and i can't see where the issue is. when i change my app name and icon my launch activity name and icon (the one that shows at the top left screen) changes to that name and icon. But when i check the xml file of the launch activity it shows me otherwise.
App name : online shop
Activity name : Anmeldung
here is the Graphical layout in eclipse of the activity and that's how it supose to be :
and here is the activity in the emulator :
Androidmanifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dbreader"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_login"
android:label="#string/activity_login"
android:theme="#style/AppTheme" >
<activity
android:name="com.hochschule.main.Login"
android:icon="#drawable/ic_launcher"
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="com.hochschule.main.Registrieren"
android:icon="#drawable/ic_registrieren"
android:label="#string/title_activity_registrieren" >
</activity>
<activity
android:name="com.hochschule.main.Shop"
android:icon="#drawable/ic_launcher"
android:label="#string/title_activity_shop" >
</activity>
<activity
android:name="com.hochschule.main.WarenKorb"
android:icon="#drawable/ic_warenkorb"
android:label="#string/title_activity_waren_korb" >
</activity>
</application>
</manifest>
Android label tag is used for both Default Title bar and App Name in Home Screen
android:label="#string/app_name"
It may conflict with activity's label name sometimes. You can apply the programmatic method as alternative which surely works.
If you want to set Activity to your desired name in onCreate() in your activity as below:
this.setTitle("Your Title");
To set Icon:
getActionBar().setIcon(R.drawable.Your_Icon);
If you are using the support library to add the actionbar (ex: ToolBar), use getSupportActionBar instead of getActionBar.
Hope this helps.
I have a problem with launching this app through menu. There is no problem when I start it using a different application that has permission. This is the manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.michael.dangerouslab" >
<uses-permission android:name="course.labs.permissions.DANGEROUS_ACTIVITY_PERM"/>
<permission android:name="course.labs.permissions.DANGEROUS_ACTIVITY_PERM"
android:protectionLevel="dangerous"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:permission="course.labs.permissions.DANGEROUS_ACTIVITY_PERM">
<activity android:name=".DangerDanger" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="course.labs.permissions.DANGEROUS_ACTIVITY"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
Delete both occurrences of android:permission="course.labs.permissions.DANGEROUS_ACTIVITY_PERM" (one in <application>, one in <activity>).
Those say "no third-party app, including the home screen, can do anything with my app, unless they have <uses-permission android:name="course.labs.permissions.DANGEROUS_ACTIVITY_PERM"/> in their manifest". There are roughly zero apps that have such an element, including roughly zero home screen implementations. Hence, you will not be able to launch your app.
This is my first time asking a question on on here, but I have found the answer to innumerable questions I've had before on here. However, I just can't make this one work. I'm simply trying to write an app to replace the homescreen. Here is what I am trying, and I can't see what I'm missing.
To keep it as simple as possible, I reduced it to just this testing application. The only thing I changed after starting a new project was the manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hometesting"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".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=".HomeActivity"
android:theme="#style/AppTheme"
android:launchMode="singleTop"
android:stateNotNeeded="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.categoty.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
I have tried it both in the emulator and my own phone, in the latter, it doesn't show up in the chooser. I can select it as the default home application in the user settings, but when i hit the home button, it just brings up the chooser without my app as an option. The pre-installed home screens and one other app that I downloaded show up as options, but my app doesn't. In the emulator, a click on the home button just brings up the default homescreen.
I have tried it with and without the separate launcher activity, and with and without the LAUNCHER intent. I have tried installing, uninstalling, restarting, and every permutation thereof.
All I want is for the home button to lead back to an activity that I wrote. Any help would be greatly appreciated.
Update: I also tried it on a generic cheap Chinese device, and still nothing.
Can anyone tell me how to change the app name? My app is taking splash as the app name on the Emulator since my first activity is splash.
EDIT:
It takes "splash" as the app name before the app is launched. Once it is launched the right name is displayed.
Manifest:
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.sanginfo.temperatureconvertor.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="com.sanginfo.temperatureconvertor.LoginActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.LoginActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
In your manifest file under application tag change this tag with whatever you want as a app name..android:label="#string/app_name"
use the name attribute on application node as describe in :
http://developer.android.com/guide/topics/manifest/application-element.html
#stylojack_10
Go to the File name String.xml (Project->res->values->string.xml)
change the value of the tag name app_name.
you can even make your own tag there and make change in Android Manifest file under tag find android:label="#string/"your custom app name""
Hope this will resolve your problem
Solution 1: (this solution works most of the time)
Go to res -> values -> strings.xml -> appname, change name of the app there.
No go to Android Manifest and check if it looks like this:
<application
android:label="#string/app_name"
.......................
>
If android:label="#string/app_name" is changed to android:label="MyApp", than change it to one shown above. Your problem should be solved.
Solution 2:
there was a file called OldAppName.launch
it is located in workspace/.metadata/.plugins/org.eclipse.debug.core/.launches
also stuff on:
/User/workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings
also a glitch in Eclipse to show old app name instead of changing the name.
I am developing an android app in eclipse. I thought I named it optimuse, that is also the title of the folder eclipse created.
But when I run the app, the name appears as "MainActivity". This is also displayed on the top of the window.
How can I change this. I checked my manifest and it said:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
...
I guess I need to change #string/app_name. But where can I do that?
PS: I did try to fill in a string instead of #string/app_name, but that did not change anything.
Thanks!
EDIT:
For clarity, here is my Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dh.optimuse"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
open the Strings.xml in values folder which is located in the res folder.
change the app_name to whatever you want
If you don't know the location.just hold ctrl and move the cursor to the #string/app_name and click. it will open strings.xml file
In addition to the previous answers:
What you are changing inside of <application> tag is the name of the app (that is shown below the app icon).
If you need to change a label for the Activity (shown at the title of the screen when the app runs), then you need to change the value of android:label inside of the <actiity> tag.