1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| // TODO Auto-generated method stub
btnStart = (Button) findViewById(R.id.btnStart);
btnStart.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
final TextView ViewtvTime = (TextView)findViewById(R.id.tvTime);
tvTimer = ViewtvTime.getText().toString();
Calendar cal = Calendar.getInstance();
reveil =cal.getTime().toString();
if(reveil.compareTo(tvTimer)==0) {
Toast.makeText(MainActivity.this,"goood",Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(MainActivity.this,"baaaaad",Toast.LENGTH_LONG).show();
}
}});
} |
Partager