i've searched the internet for this question and i couldn't find anything good. I did look on the Android Developer Site but they load a image from a URL into a ImageView.
Here is my code:
Openfactsscreen activity :
public class Openfactsscreen extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_openfactsscreen); 
        ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
        ImageAdapter adapter = new ImageAdapter(this);
        viewPager.setAdapter(adapter);
        }
        public void openmenu(View view){
        Intent intent = new Intent(this, SendFact.class);
        startActivity(intent); }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.openfactsscreen, menu);
        return true;
 }
}
ImageAdapter.java:
public class ImageAdapter extends PagerAdapter {
        Context context;
        private int[] GalImages = new int[] {
        R.drawable.factcard2,
        R.drawable.factcard8,
        R.drawable.factcard4
        };
        ImageAdapter(Context context){
        this.context=context;
        }
        @Override
        public int getCount() {
        return GalImages.length;
        }
        @Override
        public boolean isViewFromObject(View view, Object object) {
        return view == ((ImageView) object);
        }
        @Override
        public Object instantiateItem(ViewGroup container, int position) {
        ImageView imageView = new ImageView(context);
        int padding = context.getResources().getDimensionPixelSize(R.dimen.padding_medium);
        imageView.setPadding(padding, padding, padding, padding);
        imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        imageView.setImageResource(GalImages[position]);
        ((ViewPager) container).addView(imageView, 0);
        return imageView;
        }
        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
        ((ViewPager) container).removeView((ImageView) object);
        }
}
activity_openfactsscreen :
    <RelativeLayout    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/backgroundotheractivities" >
    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/imageView1" />
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:src="@drawable/factsscreen_layout" />
    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="23dp"
        android:layout_marginTop="18dp"
        android:background="@drawable/emailbutton"
        android:onClick="openmenu" />
    <ImageButton
        android:id="@+id/imageButton2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/imageButton1"
        android:layout_toRightOf="@+id/imageButton1"
        android:background="@drawable/informationbutton" />
</RelativeLayout>
Everything works fine, if anyone knows a good site to look on or if anyone wants to help me that would be great!
Anyway thanks for your time and have nice day!
 
     
     
    