Note that there are some explanatory texts on larger screens.

plurals
  1. POTheme on ProgressDialog make it fullscreen
    primarykey
    data
    text
    <p>rookie android dev here. I have a problem with some ProgressDialog in an AsyncTask.</p> <p>I want to apply a theme when I create a ProgressDialog, but when I apply it, the dialog just go fullscreen and my activity is hidden. When i remove the theme at instantiation, it's normal.</p> <p>I just want to know why.</p> <p>Here is my class with the AsyncTask :</p> <p>public class Synchronize {</p> <pre><code>private static AppManager app = AppManager.getInstance(); public void Synchronise() { } AsyncTask&lt;Void, Void, Boolean&gt; task = new AsyncTask&lt;Void, Void, Boolean&gt;() { private ProgressDialog pd; @Override protected void onPreExecute() {; pd = new ProgressDialog(app.m_AppContext, android.R.style.Theme_Black); pd.setTitle("Veulliez patienter"); pd.setMessage("Synchronisation en cours..."); pd.setCancelable(false); pd.setIndeterminate(true); pd.show(); } @Override protected Boolean doInBackground(Void... arg0) { try { //Synchronisation Thread.sleep(2000); Log.d("DEBUG","sync en cours"); } catch (InterruptedException e) { e.printStackTrace(); return false; } return true; } @Override protected void onPostExecute(Boolean result) { pd.dismiss(); if (result) Toast.makeText(app.m_AppContext, "Synchronisation terminé avec succès", Toast.LENGTH_SHORT).show(); else Toast.makeText(app.m_AppContext, "La synchronisation a échoué", Toast.LENGTH_SHORT).show(); Log.d("DEBUG","SYNC DONE"); } }; public void startSync() { if (app.m_bIsOnline) task.execute((Void[])null); else Toast.makeText(app.m_AppContext, "Mode offline. Synchronisation impossible", Toast.LENGTH_SHORT).show(); } </code></pre> <p>}</p> <p>Thanks for help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload