I have the button "saveStats" that is seems to not accept clicking.
On the emulator there is no animation of clicking.
I have tried to do clean and restart Eclipse, didnt work.
I also have CheckBox widget that works fine, only the button dont work. here is my code:
Thank for helping :)
Button saveStats;
CheckBox ageCheck, heightCheck, weightCheck, fatCheck;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.set_personal_data);
saveStats = (Button) findViewById(R.id.saveStats);
ageCheck = (CheckBox) findViewById(R.id.checkBoxAge);
heightCheck = (CheckBox) findViewById(R.id.checkBoxHeight);
weightCheck = (CheckBox) findViewById(R.id.checkBoxWeight);
fatCheck = (CheckBox) findViewById(R.id.checkBoxFat);
saveStats.setOnClickListener(this);
ageCheck.setOnClickListener(this);
heightCheck.setOnClickListener(this);
weightCheck.setOnClickListener(this);
fatCheck.setOnClickListener(this);
}
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId()){
case R.id.saveStats:
{
Toast.makeText(this, "working", Toast.LENGTH_LONG).show();
return;
}
case R.id.checkBoxAge:
{
if(ageCheck.isChecked())
Toast.makeText(this, "ok", Toast.LENGTH_LONG).show()
return;
}
////
////
////
////....
Button XML code:
<Button
android:id="@+id/saveStats"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:text="save" />