Hello I am working on an education app using android studio
Hello,
I am working on an education app using android studio. I am having problems getting data from one of my fragments to another. In one fragment I have some radio buttons. When a radio button is clicked the boolean turns true. In my last fragment I have, I want to check to see if that boolean is true. My code is not working. PLEASE HELP. I have two activites and two fragments that I will show.
Difficulty Fragment:
Difficulty Activity:
Equation Fragment:
Equation Activity:
From my main menu you will get new activities. One being to chose the type of equations, one to chose the difficulty, and one to chose the amount of equations. Once this is all done, the Equation fragment will be presented. I used a toast to see if this will work and nothing. Please help me!
Solution
Firstly, You need to edit your xml file (difficulty_selection.xml).
difficulty_selection.xml
Now Replace your DifficultyFragment.java file as follows:
Replace the code in EquationFragment.java as follows:
No change is required in your EquationActivity.java and DifficultyActivity.java
The code snippets answered here are with reference of the code given in the question.