Issue
I have an activity named "Sign In" having two buttons(signIn
and SkipNow
).
When skipNow
clicked MainActivity
opens with "FindFacilityFragment" in it and
while clicking signIn
button i want to open MainActivity with MyAccountFragment in it.
I handled skipNow
button click by inflating fragment in onCreate method of MainActivity but i am not able to handle the second click
Solution
You can send some parameter with intent like:
Intent intent = new Intent(context, MainActivity .class);
intent.putExtra("isSingedIn", true);
context.startActivity(intent);
and in MainActivity onCreate method check it like
Intent intent = getIntent();
boolean isSingedIn = intent.getBooleanExtra("isSingedIn", false);
Answered By - Vadim Eksler
Answer Checked By - Clifford M. (JavaFixing Volunteer)