How do I make a switch with two floating buttons that come from two fragments?

0

Currently I have two fragments that each in their respective layouts have a floating button that redirects me to another activity. How do I get the id of those two floating buttons in a third fragment and make a switch with them?

    
asked by Carlos 03.08.2018 в 22:52
source

1 answer

0

You can send additional data to the activiy using the putExtra method of the intent.

For example:

Intent intent = new Intent(getBaseContext(), SignoutActivity.class);
intent.putExtra("EXTRA_SESSION_ID", sessionId);
startActivity(intent);

And in the activity you can recover the value as follows:

String sessionId= getIntent().getStringExtra("EXTRA_SESSION_ID");

I hope it's useful for you.

    
answered by 04.08.2018 в 00:40