Hi,

I have a question about airplane mode broadcast intent.

The documentation says that the "state" extra value is a boolean.

http://developer.android.com/reference/android/content/Intent.html#ACTION_AIRPLANE_MODE_CHANGED

In the source of android apps, the PhoneApp reads it as integer:

if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
   boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
   ...
}

In some device (custom rom) there is an error if they try to read a
boolean:

02-01 16:46:57.088: WARN/Bundle(302): java.lang.ClassCastException:
java.lang.Integer
02-01 16:46:57.088: WARN/Bundle(302):     at
android.os.Bundle.getBoolean(Bundle.java:786)
02-01 16:46:57.088: WARN/Bundle(302):     at
android.content.Intent.getBooleanExtra(Intent.java:3259)
02-01 16:46:57.088: WARN/Bundle(302):     at com.android.phone.PhoneApp
$PhoneAppBroadcastReceiver.onReceive(PhoneApp.java:1677)

Can you help me to understand it?

It should be an integer or a boolean? Where is the mistake?

Thanks, Tamás

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to