title: Is it possible to create a ProgressBar without having to run it on a new thread?
body: <p>I have been looking at a lot of Progress Bar examples, and they all involve creating a new thread, or an async task.
  Those kinds of progress bar are the ones that pop up, updates, and disappears when the task is done.</p>
  
  <p>However, I am interested into creating a permanent ProgressBar in my app that can actually be updated by hard coding the progress.</p>
  
  <p>so here is an example code:</p>
  
  <pre><code>ProgressBar levelProgress;
  levelProgress = (ProgressBar)findViewById( R.id.progressBarLevel);
  levelProgress.setMax(100);
  levelProgress.setProgress(50); //this is what I wanted to do
  </code></pre>
  
  <p>I want to have the ProgressBar to stay as it is,
  So with the code above, I was expecting to have a permanent ProgressBar located in my layout to be half completed.
  What I actually have is an empty ProgressBar.</p>
  
  <p>The final question is, is there any way to hard code the update of a progress bar? or is it only available through an AsyncTask or a runnable Thread?</p>
  
  <p>Edit : I forgot to mention that I am implementing this as a Fragment.
  a slightly more complete code would be as follows</p>
  
  <pre><code>public class myLevelDisplayActivity extends Fragment{
  
  LinearLayout ll;
  static FragmentActivity fa;
  ProgressBar levelProgress;
  
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
      fa = super.getActivity();
      ll = (LinearLayout) inflater.inflate(R.layout.levelDisplay, container, false);
  
         levelProgress = (ProgressBar) ll.findViewById( R.id.progressBarLevel);
         levelProgress.setMax(100);
         levelProgress.setProgress(0);
         levelProgress.setProgress(10);
         levelProgress.setProgress(50);
  
   return ll;
  }
  </code></pre>
  
  <p>levelDisplay.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  
  &lt;LinearLayout xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      tools:ignore="HardcodedText,ExtraText,ExtraText,ExtraText,ExtraText,ExtraText" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="10dp" &gt;
  
  
          &lt;ImageView
              android:id="@+id/imageViewCurrentLevel"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/circle1" /&gt;
  
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:layout_marginLeft="10dp"
              android:layout_marginRight="10dp"
              android:layout_weight="0.26"
              android:orientation="vertical"&gt;
  
              &lt;TextView
                  android:id="@+id/textViewLevelTitle"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_horizontal"
                  android:gravity="center_horizontal"
                  android:text="Level Title"
                  android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content" &gt;
  
                  &lt;ProgressBar
                      android:id="@+id/progressBarLevel"
                      style="?android:attr/progressBarStyleHorizontal"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_weight="3.16"
                      android:max="100" 
                      /&gt;
  
  
  
              &lt;/LinearLayout&gt;
  
  
  
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="match_parent"
                  android:layout_gravity="center_horizontal"
                  android:layout_weight="3.16" &gt;
  
                  &lt;TextView
                      android:id="@+id/textViewCurrent"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="Current"
                      android:textAppearance="?android:attr/textAppearanceSmall" /&gt;
  
                  &lt;TextView
                      android:id="@+id/textViewSeparator"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="/"
                      android:textAppearance="?android:attr/textAppearanceSmall" /&gt;
  
                  &lt;TextView
                      android:id="@+id/textViewNextLimit"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="Next Level"
                      android:textAppearance="?android:attr/textAppearanceSmall" /&gt;
  
              &lt;/LinearLayout&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>