[android-developers] Mistake in official Sample ?

2010-11-08 Thread Omie
http://developer.android.com/resources/faq/commontasks.html#opennewscreen

Scroll down to Returning a Result from a Screen and look at code sample :

Shouldn't that be requestCode to switch() ?

// Listen for results.
protected void onActivityResult(int requestCode, int resultCode, Intent data){

// See which child activity is calling us back.
switch (*resultCode*) {

case CHOOSE_FIGHTER:
// This is the standard resultCode that is sent back if the

// activity crashed or didn't doesn't supply an explicit result.
if (resultCode == RESULT_CANCELED){

myMessageboxFunction(Fight cancelled);
}

else {
myFightFunction(data);

}
default:
break;

}
}

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

Re: [android-developers] Mistake in official Sample ?

2010-11-08 Thread Kumar Bibek
Yup, it seems so.

On Mon, Nov 8, 2010 at 6:59 PM, Omie intelom...@gmail.com wrote:


 http://developer.android.com/resources/faq/commontasks.html#opennewscreen

 Scroll down to Returning a Result from a Screen and look at code sample :

 Shouldn't that be requestCode to switch() ?

 // Listen for results.
 protected void onActivityResult(int requestCode, int resultCode, Intent data){


 // See which child activity is calling us back.
 switch (*resultCode*) {


 case CHOOSE_FIGHTER:
 // This is the standard resultCode that is sent back if the


 // activity crashed or didn't doesn't supply an explicit result.
 if (resultCode == RESULT_CANCELED){


 myMessageboxFunction(Fight cancelled);
 }


 else {
 myFightFunction(data);


 }
 default:
 break;


 }
 }


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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

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