There should be more to your stack trace, showing you the true cause
of the error.

On Wed, Jul 7, 2010 at 6:13 PM, Bret Foreman <bret.fore...@gmail.com> wrote:
> I want to monitor battery temperature, if available. I create a
> Receiver like this:
>
>    private BroadcastReceiver myTempReceiver = new BroadcastReceiver()
> {
>
>               �...@override
>                public void onReceive(Context ctx, Intent myIntent ) {
>                        int temp = myIntent.getIntExtra( 
> BatteryManager.EXTRA_TEMPERATURE ,
> 0 );
>                        commonTempLogic( (float) temp );
>                }
>
>
> And I register it like this:
>
>                registerReceiver(myTempReceiver, new
> IntentFilter(Intent.ACTION_BATTERY_CHANGED));
>
> When onReceive gets the first Intent, it fails with an exception:
>
> 07-07 22:10:01.186: ERROR/AndroidRuntime(777):
> java.lang.RuntimeException: Error receiving broadcast Intent
> { act=android.intent.action.BATTERY_CHANGED flg=0x40000000 (has
> extras) } in com.shipmate.sensorservic...@43d1b250
>
> Any idea why this might be happening?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 2.8 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to