0

guys how can i do such fullscreen progress dialog

enter image description here

i try this

<style name="MyDialog" parent="@android:style/Theme.Dialog">
        <item name="android:background">@color/loadActivitybackgr</item>
        <item name="android:textColor">#FFFFFF</item>
        <item name="android:windowBackground">@null</item>
        <item name="android:windowFrame">@null</item>
    </style>

but it is not that i need (

iCaesar
  • 421
  • 2
  • 10
  • 23
  • Add your progressbar into any layout and make it center. – Padma Kumar Jan 28 '14 at 14:38
  • http://stackoverflow.com/questions/704295/android-show-an-indeterminate-progressbar-without-the-dialog - note that you want to make sure your progress bar is set to indeterminate – Ben Pearson Jan 28 '14 at 14:42

2 Answers2

2

You don't need to use a style. create a custom layout and display it.

For Example:

res/layout/progess.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#0000FF" >

    <ProgressBar
        android:id="@+id/progressBar1"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" />

</RelativeLayout>

MainActivity.java

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.progress);
    }
}
Simulant
  • 19,190
  • 8
  • 63
  • 98
  • @iCaesar: I updated my post, but if you have trouble to display a layout you should read more about the android basics instead of asking questions here. – Simulant Jan 29 '14 at 08:13
  • in such way you post i can do this too, but i want to show this proggress bar over my main activity when downloading data and hide it when all done thats why firts i was using progress dialog and its show() and dismiss() methods ... – iCaesar Jan 29 '14 at 08:31
0

put this code where you need progress dialog

progressDialog = new ProgressDialog(activity); 
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 
progressDialog.setIcon(android.R.drawable.ic_dialog_info); 
progressDialog.setTitle("Carregando..."); 
progressDialog.setMessage("Obtendo palestras, aguarde..."); 
progressDialog.setCancelable(false); 
progressDialog.setIndeterminate(true); 
progressDialog.show(); 
sivaBE35
  • 1,876
  • 18
  • 23