Note that there are some explanatory texts on larger screens.

plurals
  1. POcreate progress dialog with another layout
    text
    copied!<p>I want to create a progress dialog which inflates another xml file.</p> <p>so i tried the following code</p> <pre><code>public class MyProgressDialog extends AlertDialog { public MyProgressDialog(Context context) { super(context,R.layout.customprog); // TODO Auto-generated constructor stub } } MyProgressDialog pdia=new MyProgressDialog(this); </code></pre> <p>and in asynctask to show this is used <code>pdia.show();</code> in onPreExecute()</p> <p><strong>porgspin.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/progress1" android:pivotX="50%" android:pivotY="50%" /&gt; </code></pre> <p><strong>customprog.xml</strong></p> <pre><code>&lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="80dp" android:padding="10dp" &gt; &lt;ProgressBar android:id="@+id/imageView1" android:indeterminateDrawable="@drawable/porgspin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:src="@drawable/progress" /&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="41dp" android:layout_toRightOf="@+id/imageView1" android:text="Loading..." android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="#000000" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>When i run the program i am unable to view the progress bar.</p> <p>What am i missing here. Please help me finding it.</p> <p>Thanks in advance.</p>
 

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