java - How to return "result" from one class to a defined class? -


i working viewpager i.e on top of mainactivity class , viewpager class extends fragment.

the problem that, when need class return result while passing intent use startactivityforresult(intent,int) hence passes result captured in secondactivity class it's been called.

but working viewpager on top of mainactivity , using floating action button, when click button open second activity returns result mainactivity not viewpager class.

so question how can pass result taken secondactivity desired class?

update:: mainactivity.java main class using intent receiving result second activity class activitytwo

what have done here

startactivityforresult(intent,1); public void onactivityresult(i,j,intent){myfragment fragment; fragment.onactivityreusult(i,j,intent);//here have passes values       received class fragment class need values it's not working } 

you can use bundle. take @ topic : bundle

bookdescfragment = new bookdescfragment(); bundle args = new bundle(); args.putint(bookdescfragment.myvariabl, variablevalue); myfragment.setarguments(args); 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -