Uninstall Android Application

When I create an Android project in Eclipse and send it to my device for debugging, the application works fine, but when I try to delete it, I get a strange message. Following are the steps to recreate my problem:

Eclipse Version: 4.2.0 Build id: I20120608-1400

ADT Version: 2.0.3 v201208082019-427395

  • Run eclipse
  • Choose File-> New-> Project ...
  • Select Android / Android Application Project
  • Click "Next."
  • Enter application name: Test
  • SDK Build: Android 4.1
  • Minimum SDK Required: API 8 Android 2.2
  • Enable: create a custom launch icon / create a project in the workspace
  • Click "Three times."
  • Click Finish.
  • Connect 4.1 Android device to computer via USB.
  • Click "Run" - "Run" from the menu.
  • Select "Android app" in the Run As pop-up window.
  • Click OK.
  • The MainActivity application runs on the device.
  • Click the back button on your Android device.
  • Open the applications on the device and find the "MainActivity" application.
  • Long press the MainActivity icon and drag it to the trash.

Here is the cryptic part:

Instead of standard

Do you want to uninstall this application?

I get a dialog with this text:

MainActivity is part of the following application: Test Do you want to uninstall this application?
  • Why am I getting this message instead of the standard one?
  • Why is MainActivity the name of the application when I specifically indicated that the name of the application is "Test"?

Additional Information: If I go to "Settings-> Applications", the application will appear as a "Test", but is indicated in my "Launch Command" as "MainActivity".

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.test" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> 

+4
source share
3 answers

The solution is to remove android: label = "@ string / title_activity_main" in the activity element.

AndroidManifest.xml below solves the problem on Android 4.1.1.

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.test" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> 
+16
source

I do not know how to solve the first problem, but the second can be solved as follows. The problem is with the new wizzard project from Android. To solve this problem, you can fix the manifest file as follows and redistribute your project:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.test" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <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> 

Remember to check what app_name . You can find more information in this post.

+1
source

Make sure your app_name not specified.

Since I used the application name somewhere else in the application, I made it in bold, for example: In my strings.xml file

 <string name="app_name"><b>We are sons<b></string> 

When i removed

 <b></b> 

he worked.

Just save it:

 <string name="app_name">We are sons</string> 
+1
source

Source: https://habr.com/ru/post/1435803/


All Articles