卸载Android应用程序 [英] Uninstalling Android Application

查看:136
本文介绍了卸载Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Eclipse中创建一个Android项目并将其发送到我的设备进行调试,应用工作正常,但是当我尝试卸载它,我得到一个奇怪的消息。下面是我的重现问题的步骤:

Eclipse版本:4.2.0版本ID:I20120608-1400

ADT版本:2.0.3 v201208082019-427395


  1. 运行Eclipse中

  2. 单击文件 - >新建 - >项目...

  3. 选择的Andr​​oid / Android的应用程序项目

  4. 点击下一步。

  5. 输入应用名称:测试

  6. 构建SDK:Android的4.1

  7. 最低要求SDK:API 8的Andr​​oid 2.2

  8. 启用:创建自定义启动图标/工作区创建项目

  9. 单击下一步三次。

  10. 单击Finish(完成)。

  11. 通过USB 4.1的Andr​​oid设备连接到计算机上。

  12. 点击运行 - >从菜单中选择运行。

  13. 在弹出的运行方式弹出选择Android应用程序。

  14. 单击确定。
  15. MainActivity应用程序在设备上运行。
  16. 点击Android设备上的后退按钮。

  17. 在设备中打开应用程序,找到MainActivity应用程序。

  18. 龙preSS在MainActivity图标并拖动到垃圾桶。

下面是令人费解的部分:

而不是得到一个标准的

你想卸载此应用?

我得到这个文本的对话框:


MainActivity是以下应用程序的一部分:测试你要卸载此应用程序吗?

  1. 为什么我得到这个消息,而不是标准之一?

  2. 为什么MainActivity当我明确表示该应用程序的名称是测试应用程序的名称?

附加信息:
如果我去设置 - >应用程序,应用程序显示为测试但在我启动的MainActivity列。

AndroidManifest.xml中

 <清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
包=com.example.test
安卓版code =1
机器人:=的versionName1.0><用途-SDK
    安卓的minSdkVersion =8
    机器人:targetSdkVersion =15/><应用
    机器人:图标=@绘制/ ic_launcher
    机器人:标签=@字符串/ APP_NAME
    机器人:主题=@风格/ AppTheme>
    <活动
        机器人:名字=。MainActivity
        机器人:标签=@字符串/ title_activity_main>
        &所述;意图滤光器>
            <作用机器人:名字=android.intent.action.MAIN/>            <类机器人:名字=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;
< /用途>


解决方案

解决方法是删除Android的:在活动元素标签=@字符串/ title_activity_main

下面的

AndroidManifest.xml中解决了在Android 4.1.1的问题。

 <清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=com.example.test
    安卓版code =1
    机器人:=的versionName1.0><用途-SDK
    安卓的minSdkVersion =8
    机器人:targetSdkVersion =15/><应用
    机器人:图标=@绘制/ ic_launcher
    机器人:标签=@字符串/ APP_NAME
    机器人:主题=@风格/ AppTheme>    <活动
        机器人:名字=MainActivity。>
        &所述;意图滤光器>
            <作用机器人:名字=android.intent.action.MAIN/>            <类机器人:名字=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;
< /用途>

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

Eclipse Version: 4.2.0 Build id: I20120608-1400

ADT Version: 2.0.3 v201208082019-427395

  1. Run Eclipse
  2. Click File->New->Project...
  3. Select Android/Android Application Project
  4. Click Next.
  5. Enter Application Name: Test
  6. Build SDK: Android 4.1
  7. Minimum Required SDK: API 8 Android 2.2
  8. Enable: Create custom launcher icon / Create project in workspace
  9. Click Next thrice.
  10. Click Finish.
  11. Connect 4.1 Android device to computer via USB.
  12. Click Run->Run from menu.
  13. Select "Android application" on popup the "Run As" popup.
  14. Click Ok.
  15. MainActivity application runs on device.
  16. Click the Back button on the Android device.
  17. Open applications on device and find "MainActivity" app.
  18. Long press the MainActivity icon and drag to trash.

Here's the puzzling part:

Instead of getting a standard

Do you want to uninstall this app?

I get a dialog with this text:

MainActivity is part of the following app: Test Do you want to uninstall this app?

  1. Why do I get this message instead of the standard one?
  2. Why is MainActivity the name of the app when I specifically stated the name of the app is "Test"?

Additional Information: If I go to Settings->Apps, the Application shows up as Test but is listed in my Launcher 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>

解决方案

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

The 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>

这篇关于卸载Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆