I have a requirement that the title bar label on my launcher activity be different from the actual launcher label. This seems to work fine in the general case, however, I have a confirmed report from a user that their launcher label has changed over time to be the activity label. Here's an example:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:label="#string/activity_title"
android:name="MyActivity" >
<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>
Upon initial install, everything is correct. The launcher label shows up as the app_name string. When you launch the app the activity label is the activity_title string. However at some point the user opens up their app list and instead of seeing the app_name string for my app, they see the activity_title string.
They have installed multiple times and this seems to happen every time. Has anyone else seen this behavior and know of a way to resolve it?
EDIT:
After some more testing I figured out how to repro this every time with the manifest given above. If I install the app, then put a shortcut on the home screen and restart the emulator or device, then when it comes back up the shortcut has been renamed. The app in the app list is still correctly named. Weird stuff.
Related
i am using one app, for example chrome with some confidential information and i am switching it to background & i am trying to kill the app.
i uploaded the example image when trying to kill the app. even the session the expired it won't close the information in the killing stage when app comes foreground then only it closes the information. i want the info should be closed or hided when it goes background (In killing stage).
i searched in google i am not getting anything related to this and i don't know whether my search phrase is correct. can anyone pleas help me.
I think ur asking this:
Just add this in manifest file:
android:excludeFromRecents="true"
Example:
<activity
android:name=".MainActivity"
android:excludeFromRecents="true"
android:taskAffinity=".OnInviteActivity"
android:noHistory="true"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
then your app will not show in background or recent app or in menu like that
UPDATE:
for ur app name only u need to add this in Main Activity:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
I wanted to start a different activity from my app first, so I moved:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
This led to an odd (but interesting problem), the name of my app (shown on home screen) has completely changed to the name of the activity that I am calling first. The thing is, I already have the name of the app declared up in the application tag:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="This should be the title, right?"
android:theme="#style/AppTheme" >
But the activity that is starting first is still the name of my app now. I have researched this thoroughly, but the only results were about how to change the name of your app,(example) which is like this:
android:label="This should be the title, right?"
But that's the strange part, as I already have that set, **yet ** the name of the app is still the name of the activity that is launching first. I would love to understand why that is happening, and how to fix this unexpected issue.
Thanks for the expert advice,
Rich
Here is my entire manifest:
https://gist.github.com/anonymous/12cd29ad7ea9b2206a2b
The caption used for the launcher icon can be driven by:
a label on the <intent-filter>, which you don't have
a label on the <activity>
a label on the <application>
So, if you have an android:label attribute on the <activity> that now has your MAIN/LAUNCHER <intent-filter>, confirm that it is what you want.
Also, home screen launchers can get a little weird at times, due to caching and such, and so a reboot of the device or emulator may be necessary.
The launcher icon will use the label of whatever activity the launcher intent-filter is in. If you want to change the title displayed in the action bar, you can call setTitle() on your Activity at runtime.
I am developing an Android app. At first everything was going smooth, but after some time, the app started to disappear (more accurate not appear) after a successful installation on a real android device. After installing it, the open button is deactivated (I can only click done) and I cannot find it on the menu, but checking with root uninstaller, it appears that the app is really installed.
On the emulator, it installs ok but the installed app doesn't show the correct icon, while prior to this error it wasn't doing so.
I forced the removal of some permissions # Manifest, because I only need (and the app was running with it only) internet access (web view). I tried removing that but it is just the same.
This change came when I introduced a splash screen which loads after the webview if it's the first time ==> MainActivity: If it's first time { setContentView with splash layout. Eventually, after the 3 slides, button onClick which changes to webview activity (class)(1) } else { setContentView with webview layout(2) }
(1) and (2) perform the same tasks, (2) inside a method in MainActivity and (1) in the onCreate of the WebView class.
I know for a fact that it is a better way to do this. Any help on how to do perform this task in a better way appreciated, and also how to get rid of the "installed but invisible" thing.
In your manifest ensure that your intent filter has the category <category android:name="android.intent.category.LAUNCHER" />
<activity
android:name=".activity.SpashScreenActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I'am using Android Studio and I have developed an Home Application by adding
<activity
android:windowSoftInputMode="stateAlwaysHidden"
android:screenOrientation="landscape"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity>
This is working and I am testing my application with run button no problem.
But after run another app from Android Studio the home application stop appearing home button selection screen.(not everytime). This is how I solve my problem
I create another application
Move files and codes to new created project.
Then my code is working with different name
This looks like a bug, I dont know what is that. Is there a way to clear cache data or another simple way to solve the problem or any suggestion?
You most likely have a different launcher set as default launcher.
In the settings of your device you should be able to set the default launcher.
Go to applications and look for your current launcher. Clear the default launcher.
If you cleared the default launcher and correctly installed your launcher, it should now ask every time which launcher to launch when you hit the home button.
Tip: Try it out on different devices and emulators!
i'm deploying an android application (Android 4.0.3) and when I press the home screen the application doesn't stay on the recent apps list. I've noticed that when I restart the application, it starts on the last screen i've navigated before press the home button. Anyone can help? Here is me Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/logo_home"
android:allowBackup="true">
<activity
android:name="com.test.activity.CommunicatorActivity"
android:launchMode="singleTop"
android:label="" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.test.activity.InputActivity"
android:windowSoftInputMode="adjustPan|stateHidden">
</activity>
<activity android:name="com.test.activity.SettingsActivity"
android:windowSoftInputMode="adjustPan|stateHidden">
</activity>
<activity android:name="com.test.activity.OutputActivity"
android:windowSoftInputMode="adjustPan|stateHidden">
</activity>
</application>
</manifest>
I'm going to go out on a limb and suggest that this is your problem:
android:label=""
In your root activity CommunicatorActivity you've set the label to be an empty string. This label is used to identify your app in the list of available apps and because it is empty, this may be causing it not to show up in the list of recent apps.
Remove android:excludeFromRecents="true" from your manifest
You should use
android:label="your app_name"
2 things
Ok, there isn't something obvious in your manifest that should prevent it from appearing in your recents list.
1. Wrong identification
It's not always straight forward to tell which task contains your activity, using the GUI.
One of the possibilities is that an activity from some other app is on top of your task making you believe that your activity isn't there. Since, clearly it resumes to the last screen.
I suggest you to remove the single top temporarily and check the same.
2. Launcher modification
Has the launcher you use the standard launcher? Has the launcher or some other app modified the presentation or behavior of the recents screen (unlikely but worth a check)
For this, I suggest using a stock launcher or try the same app on a different phone or an emulator.
What would help is steps you followed and some screen shots of recents
screen and also of your app
I had the same problem.
The reason is that I had set android:label="" in manifest.xml.
I hadn't set android:launchMode="singleTop".
I declared on purpose android:label="" because I didn't find any better way to remove the title of the action bar from my main activity.
I turned android:label="app_name" again and everything now is OK; the app appears again in recent app list when pressing the home screen and doesn't start on the last navigated screen when restarting it.