Code example for BitmapDrawable

Methods: setImageDrawable

0
		BitmapDrawable btnDoRefreshImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_refresh.png"));
		BitmapDrawable btnDoRefreshHoverImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_refresh_hover.png"));
 
		BitmapDrawable btnDoStopImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_pause.png"));
		BitmapDrawable btnDoStopHoverImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_pause_hover.png"));
 
		BitmapDrawable btnDoShareImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_share.png"));
		BitmapDrawable btnDoShareHoverImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_share_hover.png"));
 
		BitmapDrawable btnDoCloseImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_close.png"));
		BitmapDrawable btnDoCloseHoverImg = new BitmapDrawable(
			getClass().getResourceAsStream(WEBVIEW_IMAGE_BASE_PATH+"webview_bar_close_hover.png"));
 
		btnToPrev = new ImageView(this);
		btnToPrev.setId(BTN_TO_PREV);
		btnToPrev.setImageDrawable(btnToPrevGreyImg);
		btnToPrev.setTag(new BtnOnTouchListener(btnToPrevHoverImg, btnToPrevImg));
 
		btnToNext = new ImageView(this);
		btnToNext.setId(BTN_TO_NEXT);
		btnToNext.setImageDrawable(btnToNextGreyImg);
		btnToNext.setTag(new BtnOnTouchListener(btnToNextHoverImg, btnToNextImg));
 
		this.btnDoRefresh = new ImageView(this);
		this.btnDoRefresh.setId(BTN_DO_REFRESH);
		this.btnDoRefresh.setImageDrawable(btnDoStopImg);
		touchList = new ArrayList<BtnOnTouchListener>();
		touchList.add(new BtnOnTouchListener(btnDoRefreshHoverImg, btnDoRefreshImg));
		touchList.add(new BtnOnTouchListener(btnDoStopHoverImg, btnDoStopImg));
		btnDoRefresh.setTag(touchList);