I am working with ViewPager
i.e on top of the MainActivity
class and the Viewpager
class extends fragment.
The problem is that, normally when we need a class to return some result
then while passing the intent
we use startActivityforresult(intent,int)
hence it passes the result captured in the secondactivity the class from where it's been called.
But as i am working with viewpager on top of the mainactivity and i am using floating action button
, when i click the button to open the second activity it returns the result to the mainactivity but not the viewpager class.
So my question is how can i pass the result taken from the secondactivity to my desired class?
Update::
MainActivity.java
this is my main class which is using the intent as well as receiving the result from the second activity class ActivityTwo
What i have done here is
startActivityForResult(intent,1);
public void onActivityresult(i,j,intent){MyFragment fragment;
fragment.onActivityReusult(i,j,intent);//Here i have passes the values
received by this class to the fragment class where i need the values but it's not working
}