title: Progress Bar with Custom List
body: <p>Hey I am trying to implement a custom movies list using the holder pattern. Currently, I am successfully displaying the list. I want to display a progress bar with some message before the only activity get's loaded. I can't seem to wrap my head around the progress bar with async task and I have followed some examples but can't seem to understand them , can someone please advise where and what to insert in order for it to work. I would really appreciate that. </p>
  
  <p>Here is my only activity</p>
  
  <pre><code> public class MovieRatingsActivity extends ListActivity
      {
      private ArrayList&lt;Movie&gt; movies = new ArrayList&lt;Movie&gt;();
      private LayoutInflater mInflater;
  
      /** Called when the activity is first created. */
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          initializeUI();
      }
  
      private void initializeUI()
      {
          mInflater = (LayoutInflater) 
             this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);      
          InputStream inputStream = getResources().openRawResource(   R.raw.ratings);
          movies = Movie.loadFromFile(inputStream);       
          setListAdapter(new RowIconAdapter(this, R.layout.listrow, R.id.row_label, movies));
      }
  
      //declare a static holder class
      public static class ViewHolder{
          ImageView icon;
          TextView movieText,votesText;
      }
  
      /** Custom row adatper -- that displays an icon next to the movie name */
      class RowIconAdapter extends ArrayAdapter&lt;Movie&gt; 
      {
          private ArrayList&lt;Movie&gt; movies;        
          public RowIconAdapter(Context c, int rowResourceId, int textViewResourceId, 
                  ArrayList&lt;Movie&gt; items)
          {
              super(c, rowResourceId, textViewResourceId, items);
              movies  = items;
          }
  
          public View getView(int pos, View convertView, ViewGroup parent)
          {
  
              //declare a holder object
              ViewHolder holder;
              Movie currMovie = movies.get(pos);
  
              //nly inflate view once and get all the views once
              if (convertView == null)
              {
                  convertView = mInflater.inflate(R.layout.listrow, parent, false);
                  holder = new ViewHolder();
                  holder.icon = (ImageView) convertView.findViewById(R.id.row_icon);
                  holder.movieText = (TextView) convertView.findViewById(R.id.row_label);
                  holder.votesText= (TextView) convertView.findViewById(R.id.row_subtext);
  
                  //set the holder class
                  convertView.setTag(holder);
              }
  
              else{
                  //get all the views once done
                  holder = (ViewHolder) convertView.getTag();
              }
  
              //set all the values in the list
              holder.movieText.setText(currMovie.getName());
              String votesStr = currMovie.getVotes()+" votes";
              holder.votesText.setText(votesStr);
              Bitmap movieIcon = getMovieIcon(currMovie.getName(), currMovie.getRating());
              holder.icon.setImageBitmap(movieIcon);
  
              return convertView;
          }
      }
  </code></pre>
  
  <p>My layout file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;ListView
          android:id="@android:id/list" 
          android:layout_height="fill_parent"  
          android:layout_width="match_parent" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Any help would be appreciated.</p>