My goal is to call a fragment from the main activity using a button on a tool bar. I have included this toolbar on my main_activity
but what code can I write inside the main_menu
javascript so that the "finish button" on the toolbar can call a fragment. I have attached a code below:
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryforLogin"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/finish"
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:background="@color/white"
android:backgroundTint="#FFFFFF"
android:gravity="center"
android:text="Finish"
android:textColor="@color/redcolor"
android:textSize="11sp" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment