2

logcat 给了我这个错误:

ActivityManager
Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity } from ProcessRecord{b5506878 1527:com.android.launcher/u0a10002} (pid=1527, uid=10002) requires android.permission.INTERNET

Launcher
Launcher does not have the permission to launch Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity }. Make sure to create a MAIN intent-filter for the corresponding activity or use the exported attribute for this activity. tag=ApplicationInfo(title=ZavrsniApp) intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity }
Launcher
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity } from ProcessRecord{b5506878 1527:com.android.launcher/u0a10002} (pid=1527, uid=10002) requires android.permission.INTERNET
Launcher
    at com.android.launcher2.Launcher.startActivity(Launcher.java:2061)
Launcher
    at com.android.launcher2.Launcher.startActivitySafely(Launcher.java:2079)
Launcher
    at com.android.launcher2.AppsCustomizePagedView.onClick(AppsCustomizePagedView.java:577)

当我将应用程序从 eclipse 部署到模拟器时,它工作正常。当我关闭应用程序并尝试再次运行它时会出现问题,然后我收到消息:

App isn't installed

这是我的 manifest.xml

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

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="17" />
    <uses-permission
        android:name="android.permission.INTERNET"/>    

    <application
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name="zavrsni.android.app.MainActivity"
            android:permission="android.permission.INTERNET"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service
            android:name="zavrsni.android.app.service.GetAllNewData"
            android:exported="false"/>
    </application>

</manifest>

有人可以检查是什么问题吗?

非常感谢

4

1 回答 1

5

android:permission="android.permission.INTERNET"从您的<activity>元素中删除。这表示主屏幕需要持有INTERNET权限,并非所有主屏幕都会。

于 2013-06-09T13:47:31.627 回答