Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running app gives 2 app icons in Android Studio

I am running an app in Android Studio and it gives 2 app icons in Androi Studio.

Also, I have moved from Eclipse to Android Studio and now I'm having trouble with how to make the color of logcat same as in Eclipse.

My question is that there are 2 app icons when I run the app, and when I uninstall it, 2 of them have been removed. Is that normal in Android Studio? I have found that Android Studio can copy keys from Eclipse.

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.mytrack.ph"     android:versionCode="1"     android:versionName="1.0" >      <uses-sdk         android:minSdkVersion="14"         android:targetSdkVersion="19" />     <uses-feature         android:glEsVersion="0x00020000"         android:required="true"/>        <uses-permission android:name="android.permission.READ_PHONE_STATE" />       <uses-permission android:name="android.permission.INTERNET"/>     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>     <uses-permission android:name="android.permission.VIBRATE"/>     <uses-permission android:name="android.permission.WAKE_LOCK"/>     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>      <!--  Google Map v.2 permissions -->     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>      <!--  GCM permissions -->     <uses-permission android:name="android.permission.GET_ACCOUNTS" />     <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />     <permission android:name="com.example.gcm.permission.C2D_MESSAGE"         android:protectionLevel="signature" />     <uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />       <!--  Writing Persmission -->     <uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />     <uses-permission android:name="android.permission.WRITE_PROFILE" />     <uses-permission android:name="android.permission.READ_CONTACTS"/>      <uses-permission android:name="android.permission.READ_PROFILE"/>     <uses-permission android:name="android.permission.READ_CONTACT"/>      <application         android:allowBackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name" >          <activity android:name="com.mytrack.ph.SplashActivity"              android:label="@string/app_name"              android:noHistory="true"               android:screenOrientation="portrait"              android:theme="@style/splashScreenTheme" >              <intent-filter>                 <action android:name="android.intent.action.MAIN" />                 <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>         <activity             android:name="com.mytrack.ph.LoginActivity"             android:label="@string/app_name"              android:screenOrientation="portrait"            >         </activity>         <meta-data         android:name="com.google.android.gms.version"         android:value="@integer/google_play_services_version" />         <meta-data             android:name="com.google.android.maps.v2.API_KEY"             android:value="@string/google_map_api_key"/>         <activity android:name="com.facebook.LoginActivity"                   android:theme="@android:style/Theme.Translucent.NoTitleBar"                   android:label="@string/app_name" />         <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>         <service android:name="com.my.track.service.MyTrackService"></service>         <receiver             android:name="com.my.track.service.MyTrackGcmBroadcastReceiver"             android:permission="com.google.android.c2dm.permission.SEND" >             <intent-filter>                 <action android:name="com.google.android.c2dm.intent.RECEIVE" />                 <category android:name="com.my.track.service" />             </intent-filter>         </receiver>          <service android:name="com.my.track.service.MyTrackGcmIntentService" />         <activity android:name="NavigationMenuActivity"              android:configChanges="orientation|keyboardHidden"              android:screenOrientation="portrait"             android:launchMode="singleTop"             android:permission="com.google.android.c2dm.permission.SEND" >              ></activity>         <receiver android:name="com.my.track.results.ConnectionChangeReceiver" >             <intent-filter>                 <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>             </intent-filter>         </receiver>       </application>  </manifest> 

I though this is normal in android studio. Running an app gives 2 launcher icons. PS:

my AndroidManifest.xml is inside main folder and I used eclipse to export to gradle build.

Im using Android Studio 0.8.6 thanks.

like image 659
david Avatar asked Sep 10 '14 11:09

david


People also ask

Is it normal to have two launcher icons in Android Studio?

I though this is normal in android studio. Running an app gives 2 launcher icons. PS: my AndroidManifest.xml is inside main folder and I used eclipse to export to gradle build. Im using Android Studio 0.8.6 thanks. Show activity on this post. I got it! yes at last , i have to study gradles and stuff.

What is an app icon on Android?

The app icon appears in a number of places, including the Home screen, the All Apps screen, and the Settings app. You may also hear an app icon referred to as a launcher icon. Launcher refers to the experience when you hit the Home button on an Android device to view and organize your apps, add widgets and shortcuts, and more.

How to change the Android application icon?

Again, click the Run button or press shift+f10 to run the project. And choose the virtual machine or Android device and click OK to see the changes in the application icon. We have successfully changed the Android application icon. Microsoft Consultant.

How to create icons in Android Studio using C++?

Icons are part of the graphical user Interface of the mobile application. Open Android Studio and start a new Android Studio Project. You can choose your application name and choose where your project is stored. If you wish to use C++ for coding the project, mark the "Include C++ support", and click "Next" button.


2 Answers

I got it! yes at last , i have to study gradles and stuff.

Actually I have 2 android projects inside the Project, one is a library and the other one is the main app.

I found out that when i imported those projects Android Studio (I exported the lib to gradle build from eclipse) doesn't care if that is a lib project or a main project. (Correct me if im wrong ).

so the only thing to make it work is to remove the intent-filter of that lib-android-project.

EDIT: @all solved it ! thanks to everyone, I never knew there was another AndroidManifest.xml , i thought eclipse removed it. and i thought Exporting it to gradle will remove it because it is checked as a library.

thanks for all your help.

like image 137
david Avatar answered Sep 22 '22 07:09

david


The <intent-filter> that affects creating multiple launcher icon is the following one:

  <intent-filter>     <action android:name="android.intent.action.MAIN"/>     <category android:name="android.intent.category.LAUNCHER"/>   </intent-filter> 

Android Studio's manifest merger will always combine <intent-filter>s in library projects into main project's manifest. You may end up having multiple LAUNCHER intents in your synthesized manifest, thus having multiple launcher icons. To avoid this, simply remove the LAUNCHER intents from the library projects' manifest.

like image 28
Kita Avatar answered Sep 24 '22 07:09

Kita