Как установить динамические изображения для ViewFlipper в android?

Я делаю так, как это загружает эти статические изображения?

public class ArchiveGroup extends Activity  {
    Button btn;
    ViewFlipper flip;
    public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.next);
                btn=(Button)findViewById(R.id.btn);
                flip=(ViewFlipper)findViewById(R.id.flip);

        }
            public void ClickHandler(View v)
            {
             flip.showNext();
            }
            public void ClickHandler1(View v)
            {
            Toast.makeText(this,"text",Toast.LENGTH_LONG).show();
            }
}

Я использую три просмотра изображений в ViewFlipper в 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"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
    <Button
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Flip"
    android:id="@+id/btn"
    android:onClick="ClickHandler"
    />
    <ViewFlipper
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:id="@+id/flip"
    >
    <ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ic_launcher"
    />
     <ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ic_launcher"
    />
    <ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ic_launcher"
    />

    </ViewFlipper>
</LinearLayout>

Как сделать установить динамические изображения для этих imageView. Используя один ImageView.

12
задан Community 18 November 2017 в 20:47
поделиться