Search code examples
androideclipseandroid-studioandroid-studio-import

App getting installed three times when run through usb debugging after converting my project to Android Studio


i just converted my eclipse project to android studio project and installed the studio build through the USB debugging.

and i got my app installed three times, if i clicks the first app it gets open the app and if i clicks other 2 apps its get force closed. how do i remove other two same app.

i got one url about this discussion not getting solved my problem

  http://stackoverflow.com/questions/12867455/android-app-gets-installed-3-times-when-ran-once-on-android-device

Solution

  • Ensure your AndroidManifest.xml looks like this:

             ...
            <activity
                android:name=".SplashScreen"
                android:label="..."
                android:screenOrientation="portrait"
                android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    
            <activity
                android:name=".MainActivity"
                android:label="..."
                android:theme="@style/theme">
                <!--android:label="@string/app_name" >-->
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                </intent-filter>
            </activity>
    

    If you have three times

    <category android:name="android.intent.category.LAUNCHER" />
    

    You will have three icons as well. Keep this for your main activity, the one you use to launch your app. Remove it for the others.