FAQ

[android-developers] "Permission Denial: starting Intent" when launching my activity from my widget

Dirk Vranckaert
Jan 9, 2012 at 10:48 am
I'm developing the WorkTime application for Android and I am
expieriencing some strange behaviour with my widget.

SO I have a widget on which basically 3 parts are clickable:
1) The header => opens a selection dialog
2) A button => starts an activity to start a new time registration
3) The rest of the widget => launches the main screen of the
application

Before telling you my exact problem I want to mention to you that I
have tried the application on a Nexus One and two emulators (4.0.3 and
2.3.3).
The issue is only valid for the Nexus One!

So a couple of hours ago I was still using the widget normally, all
buttons were working fine.
I then installed a new version of the application (with some minor
fixus, BUT nothing changed to the widget part or any activity called
from within the widget!!!!) And suddenly when I was pressing the
header (1) or the button (2) nothing happend and (when connected to my
PC) in the LogCat I saw some exceptions (attached at the bottom!).

Before the update (so no files related to the widget or the activities
launched from the widget have changed!) everything was working fine.

I also tried uninstalling the application and installing the old
version again (the version that has worked a few hours ago), but still
the two activities could not be launched and the same exceptions are
thrown.

The latest code with which I'm having these issues is availble on
http://code.google.com/p/worktime/source/browse/trunk.

Does anyone has any idea what could have gone wrong? :s

I read somewhere that I could add the "android:exported="true""
property in the AndroidManifest.xml file for those two activities, but
why does it suddenly fail for those two activities and it still works
for the third...?

Here are the two exceptions:

01-09 11:37:43.733: WARN/ActivityManager(92): Unable to send
startActivity intent
java.lang.SecurityException: Permission Denial: starting
Intent { flg=0x10800000
cmp=eu.vranckaert.worktime/.activities.widget.SelectProjectActivity
bnds=[254,64][466,140] } from null (pid=-1, uid=10073) requires null
at
com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:
1973)
at
com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:
2271)
at
com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:
212)
at
com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:
2134)
at
android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:
211)
at
com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:
1467)
at android.os.Binder.execTransact(Binder.java:320)
at dalvik.system.NativeStart.run(Native Method)
01-09 11:37:44.253: DEBUG/dalvikvm(14556): GC_EXPLICIT freed 1582K,
52% free 4478K/9159K, external 2917K/3577K, paused 170ms
01-09 11:37:44.263: INFO/ActivityManager(92): Starting: Intent
{ flg=0x10800000
cmp=eu.vranckaert.worktime/.activities.widget.StartTimeRegistrationActivity
bnds=[269,146][451,218] } from pid -1
01-09 11:37:44.263: WARN/ActivityManager(92): Permission denied:
checkComponentPermission() reqUid=10066
01-09 11:37:44.263: WARN/ActivityManager(92): Permission Denial:
starting Intent { flg=0x10800000
cmp=eu.vranckaert.worktime/.activities.widget.StartTimeRegistrationActivity
bnds=[269,146][451,218] } from null (pid=-1, uid=10073) requires null
01-09 11:37:44.263: WARN/ActivityManager(92): Unable to send
startActivity intent
java.lang.SecurityException: Permission Denial: starting
Intent { flg=0x10800000
cmp=eu.vranckaert.worktime/.activities.widget.StartTimeRegistrationActivity
bnds=[269,146][451,218] } from null (pid=-1, uid=10073) requires null
at
com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:
1973)
at
com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:
2271)
at
com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:
212)
at
com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:
2134)
at
android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:
211)
at
com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:
1467)
at android.os.Binder.execTransact(Binder.java:320)
at com.android.server.SystemServer.init1(Native Method)
at com.android.server.SystemServer.main(SystemServer.java:625)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
597)
at dalvik.system.NativeStart.main(Native Method)

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
reply

Search Discussions

4 responses

  • Jonathan S at Jan 9, 2012 at 10:43 pm
    Look in
    https://developer.android.com/guide/topics/manifest/activity-element.html#exported

    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-developers@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en
  • Dirk Vranckaert at Jan 10, 2012 at 6:30 am
    Yes ok but it doesn't make much sense that I should set the export-
    property for 2 of my 3 activities that I'm calling from my widget,
    certainly not that it worked before... The "android:exported" property
    is only ment to be set to true if other components (so from other
    applications) must be able to call the activity.

    Any ideas?

    Kind Regards,

    Dirk
    On Jan 9, 11:43 pm, Jonathan S wrote:
    Look inhttps://developer.android.com/guide/topics/manifest/activity-element....
    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-developers@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en
  • Kostya Vasilyev at Jan 10, 2012 at 9:10 am
    From those logcat messages, I'd think that you have android:permission
    attributes on the <activity> or <application> in your manifest.

    http://developer.android.com/guide/topics/manifest/activity-element.html#prmsn


    >>>
    The name of a permission that clients must have to launch the activity or
    otherwise get it to respond to an intent. If a caller of
    startActivity()<http://developer.android.com/reference/android/content/Context.html#startActivity(android.content.Intent)>
    or startActivityForResult()<http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent,
    int)> has not been granted the specified permission, its intent will not be
    delivered to the activity.
    <<<

    -- Kostya

    10 января 2012 г. 10:30 пользователь Dirk Vranckaert <
    dirkvranckaert@gmail.com> написал:
    Yes ok but it doesn't make much sense that I should set the export-
    property for 2 of my 3 activities that I'm calling from my widget,
    certainly not that it worked before... The "android:exported" property
    is only ment to be set to true if other components (so from other
    applications) must be able to call the activity.

    Any ideas?

    Kind Regards,

    Dirk
    On Jan 9, 11:43 pm, Jonathan S wrote:
    Look inhttps://
    developer.android.com/guide/topics/manifest/activity-element....

    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-developers@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en
    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-developers@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en
  • Dirk Vranckaert at Jan 11, 2012 at 11:19 am
    Problem solved... How?
    I don't have a clue... But it's solved.
    At 4PM yesterday I tried to push the button on my widget, still same
    problem. At 8PM I tried it again and suddenly it worked... I did not
    install any upgrade or whatever so it must have been a failure of my
    Android device (Nexus1). Maybe because I was installing/removing the
    app quite some times that it started failing... But then why did it
    start again after two days or something..? No idea but I can use my
    app again so me happy :)

    Thanks for the help anyway!!!

    Kr,

    Dirk
    On Jan 10, 10:09 am, Kostya Vasilyev wrote:
    From those logcat messages, I'd think that you have android:permission
    attributes on the <activity> or <application> in your manifest.

    http://developer.android.com/guide/topics/manifest/activity-element.h...



    The name of a permission that clients must have to launch the activity or
    otherwise get it to respond to an intent. If a caller of
    startActivity()<http://developer.android.com/reference/android/content/Context.html#s...)>
    or startActivityForResult()<http://developer.android.com/reference/android/app/Activity.html#star...,
    int)> has not been granted the specified permission, its intent will not be
    delivered to the activity.
    <<<

    -- Kostya

    10 января 2012 г. 10:30 пользователь Dirk Vranckaert <
    dirkvrancka...@gmail.com> написал:






    Yes ok but it doesn't make much sense that I should set the export-
    property for 2 of my 3 activities that I'm calling from my widget,
    certainly not that it worked before... The "android:exported" property
    is only ment to be set to true if other components (so from other
    applications) must be able to call the activity.
    Any ideas?
    Kind Regards,
    Dirk
    On Jan 9, 11:43 pm, Jonathan S wrote:
    Look inhttps://
    developer.android.com/guide/topics/manifest/activity-element....
    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-developers@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en
    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-developers@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

Related Discussions

Discussion Navigation
viewthread | post