将不同内容显示到同一个ViewFlipper

public class MainActivity extends ActivityGroup {
     private ViewFlipper viewFlipper;
     ProgressDialog dialog;

    //省略
    
        /**
          * 将内容显示到ViewFlipper
          * @param intent
          */
         public void viewFlipperShow(Intent intent){
          viewFlipper.removeAllViews();
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                Window subActivity = getLocalActivityManager().startActivi("subActivity",         intent);
                viewFlipper.addView(subActivity.getDecorView(), new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                        LayoutParams.MATCH_PARENT));
         }
}


<LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="280dip"
        android:layout_marginRight="18dp"
        android:orientation="vertical" >
        <ViewFlipper
            android:id="@+id/showpic"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            
        </ViewFlipper>
        
    </LinearLayout>

你可能感兴趣的:(将不同内容显示到同一个ViewFlipper)