Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>do you still need ideas for this? I implemented the same thing in my app, but not as a dialog, I had two layouts that overlap each other. I then flip between the two layouts by setting the visibility <code>.setVisibility()</code>. As for the actual progress bar itself, I use this:</p> <p><strong>EDIT</strong>: Here's my whole XML file:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background"&gt; &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/search_header" android:background="@drawable/header"&gt; &lt;!-- Some things I need for the header (title, etc) --&gt; &lt;/RelativeLayout&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/spinner_layout" android:layout_below="@+id/search_header" android:layout_centerHorizontal="true" android:layout_centerVertical="true"&gt; &lt;ProgressBar android:id="@+id/title_progress_bar" style="?android:attr/progressBarStyleSmallTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:visibility="visible" android:indeterminateOnly="true"/&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/loading_label" android:text="Loading..." android:layout_gravity="center_vertical" android:layout_marginLeft="5dip"&gt; &lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/search_header" android:id="@+id/list_contents"&gt; &lt;!-- Stuff you want to show after returning from the AsyncTask --&gt; &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>I use this layout for an <code>Activity</code> with an <code>AsyncTask</code>, so <code>onPreExecute()</code>, I do something like:</p> <pre><code>@Override protected void onPreExecute(){ findViewById(R.id.list_contents).setVisibility(View.GONE); findViewById(R.id.spinner_layout).setVisibility(View.VISIBLE); } </code></pre> <p>And then do whatever I have to do, and <code>onPostExecute()</code> I have:</p> <pre><code>@Override protected void onPostExecute(Cursor cursor){ findViewById(R.id.list_contents).setVisibility(View.VISIBLE); findViewById(R.id.spinner_layout).setVisibility(View.GONE); } </code></pre>
    singulars
    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. VO
      singulars
      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