2011-01-14 18 views
1

Wenn Benutzer auf meine Statusleistenbenachrichtigung klickt, sollte eine Aktivitätsabsicht gestartet werden. Allerdings passiert nichts, und dies zeigt sich in LogCat:SecurityException beim Start Intent

W/ActivityManager( 85): java.lang.SecurityException: Permission Denial: starting Intent { flg=0x20000000 cmp=cz.fhejl.pubtran.london/cz.fhejl.pubtran.PubtranMapActivity bnds=[0,152][480,248] (has extras) } from null (pid=-1, uid=10049) requires null 

Die App-Paket ist cz.fhejl.pubtran.london aber die Aktivität ist in cz.fhejl.pubtran. Ist das das Problem? Meine Anwendung basiert auf einem Bibliotheksprojekt, deshalb unterscheiden sich die Paketnamen der App und der Aktivität.

Antwort

3

Mit

Intent notificationIntent = new Intent(getApplicationContext(), PubtranMapActivity.class); 

statt

Intent notificationIntent = new Intent(this, PubtranMapActivity.class); // "this" is instance of Service 

das Problem gelöst. Seltsam.

Verwandte Themen