I was curious. Consider I have One SecondActivity with ProgressBar which layout file is
<ProgressBar
android:id="@+id/progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
and In MainActivity I have Two Buttons
<Button
android:id="@+id/Button 1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/Button 2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
Both Button when clicked will open SecondActivity.
Now I would Like to show progress bar when button A is clicked but when Button B is clicked, Make the progress Bar invisible in Second Activity.
Below is diagrams illustrating above method that I would like to get.
Screenshot:
