But i really need send the BOOT_COMPLETED broadcast from my application.
There is my project
When photo boot, my service will run immediately. so i declare the
<receive> in AndroidManifest.xml
<receiver android:name=".BackgroundReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
But that service should not work when the user are not reboot his/her
photo at the first time he/she install the apk. So i want to send the
boot_completed boardcast to the backgroudReceiver manually on the
activity once the user open my app, not need to reboot phone. Do you
understand me well ?
2011/4/19 Mark Murphy <[email protected]>:
> To solve this, don't try to send a BOOT_COMPLETED broadcast from an
> SDK application.
>
> On Tue, Apr 19, 2011 at 11:22 AM, a a <[email protected]> wrote:
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): Caused by:
>> java.lang.SecurityException: Permission Denial: not allowed to send
>> broadcast android.intent.action.BOOT_COMPLETED from pid=2260,
>> uid=10060
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.os.Parcel.readException(Parcel.java:1260)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.os.Parcel.readException(Parcel.java:1248)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:1495)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.app.ContextImpl.sendBroadcast(ContextImpl.java:651)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:271)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> com.android.clocklive.SettingActivity.recoverActivity(SettingActivity.java:228)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> com.android.clocklive.SettingActivity.onResume(SettingActivity.java:95)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.app.Activity.performResume(Activity.java:4390)
>> 04-19 23:12:09.814: ERROR/AndroidRuntime(2260): at
>> android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android 3.0 Programming Books: http://commonsware.com/books
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en