I want to display ProgressBar of MainActivity from another class.
Here is Layout xml file of MainActivity and java class name is main.java.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#0844aa"
android:orientation="horizontal" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:visibility="invisible" />
</LinearLayout>
And default is invisible for ProgressBar. But I want to make “visible” this ProgressBar from another class called “subclass.java”.
Create a BaseActivity and have the both class extend it.