I want to implement ProgressDialog like this one, without additional frame.:
But I'm getting this one. How could I change that?
Here is my code for ProgressDialog. Thanks in advance
private ProgressDialog mProgressDialog;
............
mProgressDialog = new ProgressDialog(activity);
mProgressDialog.setIndeterminate(false);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
............
public class ProgressTask extends AsyncTask <Fragment,Void,Fragment>{
@Override
protected void onPreExecute(){
mProgressDialog.show();
}
@Override
protected Fragment doInBackground(Fragment... arg0) {
//my stuff is here
}
@Override
protected void onPostExecute(Fragment result) {
mProgressDialog.dismiss();
}
}
This question is related to
android
android-layout
android-progressbar
Try this.........
ProgressDialog pd1;
pd1=new ProgressDialog(<current context reference here>);
pd1.setMessage("Loading....");
pd1.setCancelable(false);
pd1.show();
To dismiss....
if(pd1!=null)
pd1.dismiss();
Put this XML to show only the wheel:
<ProgressBar
android:indeterminate="true"
android:id="@+id/marker_progress"
style="?android:attr/progressBarStyle"
android:layout_height="50dp" />
I was using View.INVISIBLE
and View.VISIBLE
and the ProgressBar
would slowly flash instead of constantly being visible, switched to View.GONE
and View.VISIBLE
and it works perfectly
Source: Stackoverflow.com