简体   繁体   English

设备上未安装Android App

[英]Android App not getting installed on device

I am working on a sample android app to learn more about android. 我正在研究一个示例android应用程序,以了解有关android的更多信息。 Strangely, the app doesn't get installed on my Motorola Xoom. 奇怪的是,该应用程序未安装在我的Motorola Xoom上。

Please note the app runs fine on the device. 请注意,该应用在设备上运行良好。 But when I see the app list on the device I can't find my app. 但是,当我在设备上看到应用程序列表时,找不到我的应用程序。

Manifest file: 清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mycamapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-feature android:name="android.hardware.camera" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.mycamapp.CameraActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <data android:mimeType="image/*" />

            </intent-filter>
        </activity>
    </application>
</manifest>

I have tried some other sample apps(hello world!! kind of examples) and they get installed on my device just fine. 我尝试了其他一些示例应用程序(您好,世界!!之类的示例),它们可以很好地安装在我的设备上。

I do not see any apk install message when I run from eclipse. 从Eclipse运行时,我看不到任何APK安装消息。 Can anyone advise, what is going wrong with the app? 任何人都可以提出建议,该应用程序出了什么问题?

I would guess the issue is with the <intent-filter> of your CameraActivity . 我猜想问题出在您的CameraActivity<intent-filter>上。 All present elements have to match, and I guess the launcher does not have a image mimeType in its intents ;) 当前所有元素都必须匹配,我猜启动器的意图中没有图像mimeType;)

Remove the <data> element from your <intent-filter> , or move it to another one, and the icon should appear. <intent-filter>删除<data>元素,或将其移至另一元素,然后将显示该图标。 You can have several intent filters for the same activity. 您可以为同一活动使用多个意图过滤器。

Source: Intents and Intent Filters 来源: 意图和意图过滤器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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