Code example for ImageButton

Methods: setImageBitmap, setEnabled, setLayoutParams, setOnClickListener

0
			seek.setPadding(7, 0, 7, 10);
			seek.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
			outer_lin.addView(seek);
			outer_lin.addView(lin);
			 
			ImageButton myLocation=new ImageButton(ctx);
			myLocation.setImageBitmap(ctx.getOverlay().getPhoneIcon());
			myLocation.setLayoutParams(lp);
			myLocation.setEnabled(ctx.getOverlay().hasPhonePos());
			lin.addView(myLocation);
 
			ImageButton ufoLocation=new ImageButton(ctx);
			ufoLocation.setImageBitmap(ctx.getOverlay().getKopterIcon());
			ufoLocation.setLayoutParams(lp);
			lin.addView(ufoLocation);
			 
			ImageButton homeLocation=new ImageButton(ctx);
			homeLocation.setImageBitmap(ctx.getOverlay().getHomeIcon());
			homeLocation.setLayoutParams(lp);
			lin.addView(homeLocation);
			 
			alert.setView(outer_lin);
			alert.setTitle("ZoomTo").setMessage("How close and to what POI should I&I zoom?");
			 
			final AlertDialog alert_dlg=alert.show();
			final MapController map_controler= ctx.getMapView().getController();
			 
			ufoLocation.setOnClickListener(new View.OnClickListener() {
				@Override 
				public void onClick(View arg0) {
					MapPrefs.setZoom2level(seek.getProgress()+ZOOM2OFFSET);
					map_controler.setZoom(MapPrefs.getZoom2level());
					map_controler.setCenter(ctx.getOverlay().getUFOPos());
					alert_dlg.hide();
				}}  ); 
			 
			 
 
			homeLocation.setOnClickListener(new View.OnClickListener() {
				@Override 
				public void onClick(View arg0) {
					MapPrefs.setZoom2level(seek.getProgress()+ZOOM2OFFSET);
					map_controler.setZoom(MapPrefs.getZoom2level());
					map_controler.setCenter(ctx.getOverlay().getHomePos());
					alert_dlg.hide();
				}}  ); 
			 
 
			myLocation.setOnClickListener(new View.OnClickListener() {
				@Override 
				public void onClick(View arg0) {
					MapPrefs.setZoom2level(seek.getProgress()+ZOOM2OFFSET);
					map_controler.setZoom(MapPrefs.getZoom2level());
					map_controler.setCenter(ctx.getOverlay().getPhonePos());