Reading
Add Comment
Android ProgressBar Example Code
In this sample, we are showing the advancement dialog for sham document download operation.
Here we are utilizing android.app.ProgressDialog class to demonstrate the advancement bar. Android ProgressDialog is the subclass of AlertDialog class.
The ProgressDialog class gives strategies to take a shot at advancement bar like setProgress(), setMessage(), setProgressStyle(), setMax(), show() and so on. The advancement scope of Progress Dialog is 0 to 10000.
We should see a basic case to show advancement bar in android.
Android Progress Bar Example by ProgressDialog
We should see a basic sample to make advancement bar utilizing ProgressDialog class.
activity_main.xml
Drag one catch from the pallete, now the activity_main.xml record will resemble this:
File: activity_main.xml
<RelativeLayout xmlns:androclass="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="116dp"
android:text="download file" />
</RelativeLayout>
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="116dp"
android:text="download file" />
</RelativeLayout>
0 comments:
Post a Comment