SHARE
TWEET

Untitled

a guest Mar 21st, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this is the code
  2.  
  3.  
  4.  
  5.  buttonalarm = (Button) findViewById(R.id.buttonalarm);
  6.     buttonalarm.setOnClickListener(new View.OnClickListener() {
  7.         @Override
  8.         public void onClick(View v) {
  9.             int hour = Integer.parseInt(houredit.getText().toString());
  10.             int minute = Integer.parseInt(minuteedit.getText().toString());
  11.             Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM);
  12.             intent.putExtra(AlarmClock.EXTRA_HOUR, hour);
  13.             intent.putExtra(AlarmClock.EXTRA_MINUTES, minute);
  14.  
  15.             if (hour <= 24 && minute <= 60) {
  16.                 startActivity(intent);
  17.  
  18.             }
  19.         }
  20.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top