Code example for ImageSwitcher

Methods: setImageDrawable

0
  public void handleReceivedPacket(AbstractPacket reply) {
 
  } 
 
  public void onItemSelected(AdapterView parent, View v, int position, long id) {
    mSwitcher.setImageDrawable(((ImageView)v).getDrawable());
  } 
 
  public Drawable getDrawable(int position) {
    return new BitmapDrawable(getBitmap(position));
  } 
   
  public Bitmap getBitmap(int position) {
    Bitmap bitmap = null;
    try { 
      URL aURL = new URL(mImages.get(position) + "?sessionId=" + getSessionId());
      URLConnection conn = aURL.openConnection();
      conn.connect();
      InputStream is = conn.getInputStream();
      BufferedInputStream bis = new BufferedInputStream(is);
      Bitmap bm = BitmapFactory.decodeStream(bis);