嗨,希望有人可以提供帮助,
我正在做一个课程,他们正在测试我们的Android权限,我们目前的任务是有两个包,其中一个可以调用另一个包,我称之为呼叫包和叫包裹。
Called Package中没有什么特别之处,这是一个非常简单的方法,它只加载一个非常简单的布局文件,因此所有权限的定制都在Manifest文件中完成。
我的问题是, a)我的呼叫应用程序似乎工作正常,即它调用被叫应用程序,一切似乎工作正常。在LogCat中无需报告任何问题 b)但是,如果我尝试直接从加载到模拟器或真实设备上的应用程序启动我的Called应用程序,我会收到一条消息“应用程序未安装”,LogCat中没有出现任何内容
所以我附上了Called应用程序的清单文件,你会发现// TODO部分,我的代码偏离了我提供的文件。
感谢您的关注,这是Called应用程序的Manifest文件,它必须是bug:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="course.labs.dangerousapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="19" />
<!--
TODO - Using a permission element,
define a custom permission with name
"course.labs.permissions.DANGEROUS_ACTIVITY_PERM"
and "dangerous" protection level.
-->
<permission
android:name="course.labs.permissions.DANGEROUS_ACTIVITY_PERM"
android:description="@string/permission_description"
android:label="@string/permission_label"
android:protectionLevel="dangerous" >
</permission>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<!-- TODO - enforce the custom permission on this Activity -->
<activity
android:name=".DangerousActivity"
android:label="@string/app_name"
android:permission="course.labs.permissions.DANGEROUS_ACTIVITY_PERM" >
<!--
TODO - add additional intent filter info so that this Activity
will respond to an Implicit Intent with the action
"course.labs.permissions.DANGEROUS_ACTIVITY"
-->
<intent-filter>
<action android:name="course.labs.permissions.DANGEROUS_ACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
答案 0 :(得分:3)
MainActivity
,因为主屏幕不具有course.labs.permissions.DANGEROUS_ACTIVITY_PERM
权限,并且您正在使用该权限为该活动辩护。