Separate Launcher and Activity icon with Android - android

I've got a simple application with one single activity. Actually, the launcher icon is the same as the activity's one (the one in the top-left corner). I would like to put another icon in my activity without changing the launchers'one.
Here is my manifest :
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.natinusala.pebkac.MainActivity"
android:label="#string/app_name">
<intent-filter android:logo="#drawable/pebkac">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Actually, I can edit the launcher and activity icon by editing the android:icon="#drawable/ic_launcher" line. I can do it also in adding an android:icon into the <activity> but it modify too the launcher's icon.
How can I do to edit my activity's icon without touching the launcher's one ?
Thanks !

In your manifest, add android:logo="#drawable/ic_yourIcon" to either your Activity or Application tag.

Related

Android splash screen dynamic icon

In our app we have several launcher icons. We do it via activity-alias. Code in Manifest looks like below. The problem is that I can't show different splash screen logos. Splash screen style is used only from <activity> tag. The one in <activity-alias> tag is ignored.
<activity
android:name=".modules.launcher.LauncherActivity"
android:theme="#style/Theme.App.MainLauncherStyle" />
<activity-alias
android:name="${applicationId}.MainLauncherAlias"
android:enabled="true"
android:icon="#mipmap/launcher_main"
android:label="#string/App_Name"
android:exported="true"
android:theme="#style/Theme.App.MainLauncherStyle"
android:targetActivity=".modules.launcher.LauncherActivity">
</activity-alias>
<activity-alias
android:name="${applicationId}.DarkLauncherAlias"
android:enabled="false"
android:icon="#mipmap/launcher_dark"
android:label="#string/App_Name"
android:exported="true"
android:theme="#style/Theme.App.DarkLauncherStyle"
android:targetActivity=".modules.launcher.LauncherActivity">
</activity-alias>

How do I change the app icon in the 'Recents' Screen?

I know how to change the icon of my app, but when I look at the Recents Screen, the icon is the default one.
App icon (all good so far):
Icon in my Recents Screen:
This is the 'application' tag of my 'AndroidManifest.xml'
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/iconout"
android:roundIcon="#mipmap/iconout"
android:logo="#mipmap/iconout"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
I've tried many solutions that I found on this platorm (that didn't work), like:
file->new->image asset->choose image..
install & unistall the app
build & clean project
delete all the default icons on my project
drag & drop my icon to drawable from mipmap folder
Any other possible solutions? Thank you in advance!
Ok I found the solution and decided to answer for anyone that will encounter the same problem in the future.
I fixed it by adding android:icon="#mipmap/iconout" in the main activity tag declaration in the AndroidManifest.xml, like so:
<activity
android:icon="#mipmap/iconout"
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
And here's the final result:
Try to change the format of the icon to PNG. That works for me.
Or you could try the application on different devices to see if it's not a problem of the emulator/phone.

Don't want to show label and settings menu on my main screen

I wanted to show first screen (user's registration) without label and settings menu.
would someone please suggest me how?
Following is the code from manifest.xml
<activity
android:name=".LoginActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
The settings icon is the menu option in Android. To remove that just remove the onCreateOptionsMenu() method. But since you also want to remove the title, all in all what you are asking is to remove the action bar itself. That means you want a full screen activity and for that you can simply set a style in the android manifest.
<activity android:name=".LoginActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"/>

Icon prolem in the settings

I have a little problem, my appliction always display my icon in the menu, home screen stc. My app is a wallpaper app, but in the wallpaper setting list always display a gray images without my icon. Where I can configure that?
In AndroidManifest.xml find application tag and add android:icon="#drawable/icon" replacing icon with id of your resource.
Something like this:
<activity
android:name="com.cotv.MainActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#style/QTheme.PageIndicatorDefaults" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

How to not display Android application Name on every screen

I am finding that in my Android application, the name of the application is displaying on the top of every screen, consuming a line of valuable screen real estate.
I am using LinearLayouts
How can I get this not to display?
You can set it in the Activity/Application tags in the manifest XML:
android:theme="#android:style/Theme.NoTitleBar"
See more here (Styles and Themes).
Or write in onCreate yours Activity before setContentView():
requestWindowFeature(Window.FEATURE_NO_TITLE);
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen">
<activity
android:name=".A"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
you can add this line android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen" to the manifest and make your application fullscreen and without title bar
and if you want to remove only the title bar and don't want to make the application full screen then you can use Theme.NoTitleBar
Change your activities' theme like that
<activity android:name=".Activity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
android:theme="#style/AppTheme"
Above change in Manifest file didn't work for me.
requestWindowFeature(Window.FEATURE_NO_TITLE)
For this to work in your project you have to make one more change. Make your acivity extends Activity instead of AppCompactActivity which comes by default.
Thank You.

Categories

Resources