Code example for ImageSwitcher

Methods: setImageResource

0
        g.setAdapter(new ImageAdapter(this));
        g.setOnItemSelectedListener(this);
    } 
 
    public void onItemSelected(AdapterView<?> parent, View v, int position, long id) {
        mSwitcher.setImageResource(mImageIds[position]);
    } 
 
    public void onNothingSelected(AdapterView<?> parent) {
    } 
 
    public View makeView() {
        ImageView i = new ImageView(this);
        i.setBackgroundColor(0xFF000000);
        i.setScaleType(ImageView.ScaleType.FIT_CENTER);
        i.setLayoutParams(new ImageSwitcher.LayoutParams(LayoutParams.MATCH_PARENT,
                LayoutParams.MATCH_PARENT));
        return i;
    } 
 
Connect your IDE to all the code out there  Get Codota for Java