Q6

Question 6

Create a menu with 5 options and selected options should appear in text box.

App Insights:

Created the menu folder "res" folder. Made the Java Activity code and use Menu resource for the option menu and display using TextView

Browse Source Code

Code

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Menu Options!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Output

Studio Screenshot Main Activity (1/14)
App Screenshot Main Activity (2/14)
Studio Screenshot Displaying Menu Options (3/14)
App Screenshot Displaying Menu Options (4/14
Studio Screenshot Displaying Chosen Option (5/14)
App Screenshot Displaying Chosen Option (6/14)
Studio Screenshot Displaying Chosen Option (7/14)
App Screenshot Displaying Chosen Option (8/14)
Studio Screenshot Displaying Chosen Option (9/14)
App Screenshot Displaying Chosen Option (10/14)
Studio Screenshot Displaying Chosen Option (11/14)
App Screenshot Displaying Chosen Option (12/14)
Studio Screenshot Displaying Chosen Option (13/14)
App Screenshot Displaying Chosen Option (14/14)

****

Last updated