Hi guys it's me again. I would like some help whit a little problem.,
I can't recovery the value of the activity that i call. Look the
follow code.
Manifest
<activity android:name="search" android:label="@string/app_name"
android:theme="@android:style/Theme.Dialog">
<intent-filter android:label="@string/
resolve_title">
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
</activity>
Main class prueba how extends of mapActivity
this is the way what I call the actvity
Intent i = new Intent(prueba.this, search.class);
startActivityForResult(i, GET_CODE);
This is the metod which is waiting for the value
protected void onActivityResult(int requestCode, int resultCode,
String data, Bundle extras){
switch (resultCode) {
case GET_CODE:
// 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){
}
else {
}
default:
break;
}
Search class how extend of Activity
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Bundle stats = new Bundle();
stats.putString(ACTIVITY_SERVICE, mText.getText().toString());
Intent mIntent = new Intent();
mIntent.putExtras(stats);
setResult(RESULT_OK, mIntent);
finish();
}
When you use setResult it suppose that the values are sent to the
class how call the activity.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---