1

I started in my app this activity

var RecordIntent= new Intent(RecognizerIntent.ActionRecognizeSpeech);
StartActivityForResult(RecordIntent, (int)ResultActivityCodes.SpeechResult);

and i have StopRecord function

    void StopRecord()
     {
            SetResult(Result.Ok,RecordIntent); 
            FinishActivity((int)ResultActivityCodes.SpeechResult);
     }

after execute StopRecord() function called OnActivityResult(int requestCode, Result resultCode, Intent data)

why data has been null in OnActivityResult?

how to stop correctly my Activity that variable "data" was not null

Artem Polishchuk
  • 505
  • 5
  • 17

1 Answers1

0

You need to use setResult(int, intent) method in started activity before it will be destroyed. The second parameter is a data parameter of onActivityResult() method.

Roman Black
  • 3,501
  • 1
  • 22
  • 31
  • update: nope it is not work, for start activity i use StartActivityForResult(RecordIntent, (int)ResultActivityCodes.SpeechResult); and for stop SetResult(Result.Ok,RecordIntent); FinishActivity((int)ResultActivityCodes.SpeechResult); my data is null again! – Artem Polishchuk Apr 10 '14 at 13:21