This is the Progress Bar . You can create this programmatically or using a widget in XML.
For implementation in XML:
<ProgressBar android:id="@+id/progress_loader" style="?android:attr/progressBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:visibility="visible" />
To implement in Java (using the Progress Dialog , as you requested in the comments, but you can also do it with the Progress Bar )
ProgressDialog nDialog; nDialog = new ProgressDialog(Login.this); nDialog.setMessage("Loading.."); nDialog.setTitle("Get Data"); nDialog.setIndeterminate(false); nDialog.setCancelable(true); nDialog.show();
Before reaching the next action, you must dismiss() progress bar.
nDialog.dismiss();
Parama sudha
source share