Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android homescreen shortcut permission error

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

like image 792
Isaac Waller Avatar asked Mar 02 '09 04:03

Isaac Waller


3 Answers

I ran into this problem too, and it turned out it was because the Activity wasn't exposed to other processes. I had to add the android:exported="true" attribute to the activity tag in my manifest.

See http://developer.android.com/guide/topics/manifest/activity-element.html#exported for more information.

like image 97
staktrace Avatar answered Oct 16 '22 04:10

staktrace


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.

like image 39
Malachi Avatar answered Oct 16 '22 03:10

Malachi


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

<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
</intent-filter>
like image 25
Isaac Waller Avatar answered Oct 16 '22 05:10

Isaac Waller