Well, I can reproduce your behavior. It's not tied to
onActivityResult() -- any switch statement has the effect:
public class MyApp extends Activity {
static final int RC_OTHER=0x7fffffff;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int i=RC_OTHER;
switch (i) {
case RC_OTHER:
Log.d("MyApp", "a");
break;
default:
Log.d("MyApp", "b");
break;
}
finish();
}
}
That dumps "b" where it should show "a", and does show "a" for every
other RC_OTHER value I've tried.
It works when the switch() is converted to an if().
It works if, using the same Java compiler, I try the same case
statement, dumping to System.out. So, it's not a javac bytecode
generation error -- it's in Dalvik somewhere (tools or VM).
So, it would appear to be a real bug. I have filed an issue:
http://code.google.com/p/android/issues/detail?id=22344
The workaround is to pick any other value, or use if().
Thanks for pointing this out!
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Warescription: Three Android Books, Plus Updates, One Low Price!
--
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