Sunday, July 24, 2011

[android-developers] starting service from launch icon

hi,
Im working on API 7 and I need to launch service without showing any
activity, my service will add status bar notification so user can
interact with application later.

I cant find any other solution then launching activity that will
finish immediately after starting service but this shows a blank,
white screen for a second so this is rather poor workaround.

I tried using broadcast receiver but this cannot be launched by
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
I got error ERROR/Launcher(105): Launcher does not have the permission
to launch Intent
{ act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=myapp.launcher/.SettingsActivity bnds=[83,238][157,317] }.
Make sure to create a MAIN intent-filter for the corresponding
activity or use the exported attribute for this activity.

I know there are apps out there which are doing that (or at least
looks like that) so there must be a way, thanks for help

--
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

No comments:

Post a Comment