1

I want to show progress bar to going from one activity to another activity until another activity is loaded can anybody give example

Thanks

mohan
  • 13,035
  • 29
  • 108
  • 178
  • 1
    i think you are talking about Progress dialog(loading wheel). – Piyush Nov 30 '10 at 09:45
  • possible duplicate of [Progress Dialog on open activity](http://stackoverflow.com/questions/4254139/progress-dialog-on-open-activity) – Pentium10 Nov 30 '10 at 10:37

2 Answers2

1

You can't have a progress to be displayed when switching to a new activity from current activity.

Pritam
  • 339
  • 3
  • 23
Pentium10
  • 204,586
  • 122
  • 423
  • 502
0

You can do this by declaring two progressbar inside a ViewFlipper in xml.

    <?xml version="1.0" encoding="utf-8"?>
      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/lah"
        >
       <ViewFlipper 
        android:id="@+id/myFlipper"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent" 
        >
            <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

            <ProgressBar 
                      android:id="@+id/first_progressbar" />
            </LinearLayout> 



            <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

            <ProgressBar 
                      android:id="@+id/second_progressbar" />

            </LinearLayout> 


      </ViewFlipper>

  </LinearLayout>

Then in your java program create a ViewFlipper object.

    ViewFlipper vf = (ViewFlipper) findViewById( R.id.myFlipper);

And call

    vf.showNext();

Thus you can show two ProgressBar. You can also apply animation that seems ProgressBars moves from one activity to next. Thanks...

    vf.setInAnimation(AnimationUtils.loadAnimation( getApplicationContext(), R.anim.right_in ));
    vf.setOutAnimation( AnimationUtils.loadAnimation( getApplicationContext(), R.anim.left_out ));
    vf.showNext();
Imdad Sarkar
  • 1,245
  • 2
  • 12
  • 24