I am new to Java and Android Studio. I am trying to create a app where a user selects an option from a list of radio buttons and there are multiple of these activities. In the last activity, I would like to display certain text based on which 2 radio buttons have been selected previously. So for example, if the user selects Option A from activity 1, then Option B from activity 2, then the text in the 3rd activity should read "You should read Harry Potter next." Thanks for your help, I would really appreciate it.

    <?xml version="1.0" encoding="utf-8"?>
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background"
android:orientation="vertical">

<TextView
    android:id="@+id/textView"
    android:layout_width="match_parent"
    android:layout_height="129dp"
    android:fontFamily="serif"
    android:gravity="center"
    android:text="@string/choose_your_favorite_genre"
    android:textColor="@android:color/white"
    android:textSize="20sp"
    android:textStyle="bold" />

<RadioButton
    android:id="@+id/radio_genre2"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:fontFamily="serif"
    android:gravity="center"
    android:text="@string/fantasy"
    android:textSize="20sp"
    android:buttonTint="#3700B3"
    android:checked="true"
    android:textColor="@android:color/white" />

<RadioButton
    android:id="@+id/radio_genre1"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:fontFamily="serif"
    android:gravity="center"
    android:text="@string/mystery"
    android:textSize="20sp"
    android:buttonTint="#3700B3"
    android:checked="true"
    android:textColor="@android:color/white" />

<Button
    android:id="@+id/button2"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:fontFamily="serif"
    android:gravity="center"
    android:textSize="20sp"
    android:text="@string/next" />

Looking for what to add to the main activity of the last activity where I can edit the text of textview based on user selection.

0

There are 0 best solutions below