Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - checkbox validation by clicking button

checkbox validation by clicking button

Put your problem here if it does not fit any of the other categories.

checkbox validation by clicking button

Postby Ugandhar » Mon May 03, 2010 3:04 pm

Hi to all,

I am new to android, I got problem with checkbox validation in android. When i click a button i should able to validate the checkbox, if it is checked i have to start new activity, if it is not checked i have to display error message as checkbox not checked.

Following is my code:

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListe ner;

public class PreferenceMain extends Activity implements OnCheckedChangeListener {

CheckBox c1;
Context ctxt;
Button prefBtn;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

c1 = (CheckBox) findViewById(R.id.check1);
prefBtn = (Button) findViewById(R.id.button);


prefBtn.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
Log.d("Debug", "Button Clicked");
perform();


}
});
}


public void perform(){
if (c1.isChecked()){
Intent result = new Intent(getBaseContext(), Result.class);
startActivity(result);
}
else
//Should display alert to check the check box

}
}


Please help me, I am vexed with this issue almost for four days....

Thanks in advance

Regards,
Ugandhar
Ugandhar
Once Poster
Once Poster
 
Posts: 1
Joined: Mon May 03, 2010 2:59 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 9 guests