I have a weird problem. When i click the first time on the checkbox it works, but when i uncheck and check again, the image won`t show. Please help.
private void ratedialog() {
dialog = new Dialog(this);
dialog.setContentView(R.layout.dialog);
dialog.setTitle("Rate it!");
dialog.setCancelable(true);
dialog.show();
seekbar = (SeekBar) dialog.findViewById(R.id.rate_seekbar);
button_done = (Button) dialog.findViewById(R.id.button_done);
seekbar_result = (TextView) dialog.findViewById(R.id.seekbar_result);
checkBox_seen = (CheckBox) dialog.findViewById(R.id.checkBox_seen);
button_done.setOnClickListener(EditActivity.this);
seekbar.setOnSeekBarChangeListener(EditActivity.this);
checkBox_seen.setOnCheckedChangeListener(EditActivity.this);
seekbar.setProgress(rate);
}
Listener:
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Log.e(TAG, isChecked+"");
if (isChecked) {
//seen = true;
checkBox_seen.setChecked(true);
Log.e(TAG, "Second time " + isChecked + "");
image_seen.setImageResource(R.drawable.seen);
} else {
// seen = false;
checkBox_seen.setChecked(false);
Log.e(TAG, "Third time" + isChecked + "");
image_seen.setVisibility(View.INVISIBLE);
}
}
Aucun commentaire:
Enregistrer un commentaire