How can I get data from Sub Sub Activity?PLEASE URGENT HELP

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

How can I get data from Sub Sub Activity?PLEASE URGENT HELP

Postby bavarol » Tue Jun 03, 2008 7:07 am

Hi,
how could I get data from a Sub Sub Activity?

A1, A2 and A3 are Activities.

A2 is Subactivity of A1
A3 is subactivity of A2 and Sub Sub Activity of A1

D3 is the return value from A3

This would be the sequence

A1-startSubactivity(...)->A2-startSubactivity(...)->A3
D3 <-[Here is myProblem] - D3 <- setResult(...) - D3


I know, what I must do, if I want to get Results(See Subactivities with return value ) from a Subactivity but I don't know, what I should do.

How can I pass to A1 this data(D3)?
I would eternally thank somebody, who helps me.

Thanks for all
Last edited by bavarol on Tue Jun 03, 2008 1:16 pm, edited 1 time in total.
bavarol
Experienced Developer
Experienced Developer
 
Posts: 52
Joined: Mon Dec 10, 2007 9:19 pm

Top

SOLVED

Postby bavarol » Tue Jun 03, 2008 12:54 pm

I have solved it, hurra!!!
On Activity2 you should write the next

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     protected void onActivityResult(int requestCode, int resultCode,
  2.                         String data, Bundle extras){
  3.                                
  4.                                
  5.                                
  6.                                 if(requestCode == GET_CODE){
  7.                                        
  8.                                         if(resultCode == RESULT_OK){
  9.                                                
  10.                                                 Activity2.this.setResult(RESULT_OK,data,extras);
  11.                                                
  12.                                                 Activity2.this.finish(); <span style="color: red">// VERY IMPORTANT</span>
  13.                                                
  14.                                         }
  15.                                        
  16.                                 }
  17.                                
  18.                        
  19.                         }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


The Method finish() is not synchronized to the Subactivity's(In my case Activity3) return, therefore there was not time to get the data of onActivityResult(...), it finished too soon.

;)
bavarol
Experienced Developer
Experienced Developer
 
Posts: 52
Joined: Mon Dec 10, 2007 9:19 pm

Top

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest