views:

2231

answers:

5

Hello,
In my program it adds a shortcut to the screen. I get the icon on the screen fine, but when I tap it, I get:

03-01 20:00:29.410: ERROR/AndroidRuntime(796): java.lang.SecurityException: Permission Denial: starting Intent { data=http://www.example.com/ flags=0x14000000 comp={com.isaacwaller.example/com.isaacwaller.example.ExampleCut} } from ProcessRecord{435c7398 796:android.process.acore/10005} (pid=796, uid=10005) requires null

Do you know the problem? Thanks,
Isaac

+2  A: 

I haven't run into this personally but I did do some research and found the following.

Apparently whatever is attempting to invoke your app or if your app has a call to create an intent and start an activity of some intent the UID is not the same.

In ActivityManagerServer.java there are below judgement in it.

int checkComponentPermission(String permission, int pid, int uid, int reqUid)
// If the target requires a specific UID, always fail for others.
   if (reqUid >= 0 && uid != reqUid) {
       return PackageManager.PERMISSION_DENIED;
   }

I'm going to do some testing on this and see if I can reproduce this in a test application and provide any additional feedback.

Make sure you are only trying to invoke publicly exposed activities through any intents.

Quintin Robinson
+1  A: 

Figured it out, added this under <activity> tag of activity:

<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
</intent-filter>
Isaac Waller
Could you show us the complete (fixed) Mainfest?
fiXedd
+2  A: 

Something like this should work:

<intent-filter>
    <action android:name="com.example.Project.Action"/>
    <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

inside of the Activity declaration in the manifest.

fiXedd
A: 

Hi Isaa can you share your code to create a shortcut, because i m trying it but nothing, please and thanks

Moise

Moise
A: 

I had something like this happen when I had accidentally duplicated the activity tag for one of my activities in my manifest. I had something like this in my application section.

<activity android:name=".ConventionHome" android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

<activity android:name="ConventionHome"></activity>

When I removed the second activity tag, things started working normally.

Malachi