I currently added two ImageButtons on my android application project, but when I press then on my android device, there is no effect that the button gets indented. How can I put an effect to it so it looks more like a button when it's pressed?
My full source code looks something like this:
final TextView text2 = (TextView) findViewById(R.id.textView2);
text2.setText("");
final TextView text = (TextView) findViewById(R.id.textView1);
text.setText("");
final Button button3 = (Button) findViewById(R.id.button1);
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
clicked1 = 0;
clicked2 = 0;
text2.setText(" " + clicked1 + " SHOTS ");
text.setText(" " + clicked2 + " CUPS ");
}
});
final TextView text1 = (TextView) findViewById(R.id.textView2);
text1.setText(" 0 SHOTS");
final ImageButton button2 = (ImageButton) findViewById(R.id.imageButton2);
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
clicked2++;
text1.setText(" " + clicked2 + " SHOTS ");
}
});
final TextView text3 = (TextView) findViewById(R.id.textView1);
text3.setText(" 0 CUPS");
final ImageButton button = (ImageButton)findViewById(R.id.imageButton1);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
clicked1++;
text3.setText(" " + clicked1 + " CUPS ");
}
});
}
}