protected
void
onCreate(Bundle bun) {
super
.onCreate(bun);
textStreamed = (TextView) findViewById(R.id.text_kb_streamed);
streamButton2 = (CheckBox) findViewById(R.id.button_stream);
LinearLayout linearLayout =
new
LinearLayout(
this
);
linearLayout.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams params =
new
LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
Resources r = getResources();
Bitmap bmp1 = BitmapFactory.decodeResource(r, R.drawable.off);
final
ImageButton imgbutton1 =
new
ImageButton(
this
);
imgbutton1.setImageBitmap(bmp1);
imgbutton1.setBackgroundColor(Color.TRANSPARENT);
imgbutton1.setPadding(
0
,
400
,
0
,
0
);
imgbutton1.setOnClickListener(
new
OnClickListener(){
@Override
public
void
onClick(View v){
if
(bool ==
false
){
imgbutton1.setImageResource(R.drawable.on);
bool =
true
;
}
else
{
imgbutton1.setImageResource(R.drawable.off);
bool =
false
;
}
}
});