简体   繁体   中英

how do I inherit launcher icons from a library project in android?

I have several apps dependent on a library project. I wish them all to use the same launcher icons. Unfortunately this doesn't seem to be getting inherited?

I'm getting the generic icon for android...

I had the same problem: my App does not select the launcher icon on the library project but uses the default Android icon.

As suggested in comments, I inserted a line in the manifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:mylib="schemas.android.com/apk/res/mylib.libpackage.libbase 
    package="myapp.apppackage.appbase"
    android:versionCode="100"
    android:versionName="2.1.0" >

The line is:

xmlns:base="schemas.android.com/apk/res/mylib.libpackage.libbase 

the name space mylib.libpackage.libbase is the package name defined in the library manifes.xml.

to reference the launcher icon use

android:icon="@mylib:drawable/ic_launcher"

But.. this not works for me!

Simply I found I need to use the standard approach:

android:icon="@drawable/ic_launcher"

and deleted the ic_launcher resource form all libraries used in my project (except for the library used as icon resource).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM