[英]Permission Denial: starting Intent
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
这是我的清单。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>
有人可以检查是什么问题吗?
非常感谢
从您的<activity>
元素中删除android:permission="android.permission.INTERNET"
。 也就是说, 主屏幕需要持有INTERNET
权限,并非所有主屏幕都需要。
如果上述解决方案不适合您,请检查您的 Launcher 活动是否设置为
android:exported="true"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.