title: Toast after seconds set by timepicker when screen off android
body: <p>i can detect when the screen turns off in this way:</p>
  
  <pre><code>IntentFilter intentFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
  intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
  registerReceiver(new BroadcastReceiver() {
      @Override
      public void onReceive(Context context, Intent intent) {
          if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
              Toast.makeText(MainActivity.this, "Screen off", Toast.LENGTH_SHORT).show();
          } else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
              Toast.makeText(MainActivity.this, "Screen on", Toast.LENGTH_SHORT).show();
          }
      }
  }, intentFilter);
  </code></pre>
  
  <p>I need do the same thing, but the <code>Toast</code> will have to appears after a certain seconds that i can set through a <code>timePicker</code>. So every time the screen turns off, if i set 10 seconds, after 10 seconds i will get a toast. How can i do it? Do i need a service?
  Manually i can do something like this:</p>
  
  <pre><code>new Handler().postDelayed(new Runnable() {
  
          @Override
          public void run() {
  
               // here the code
          }
  }, 30 * 1000);
  </code></pre>
  
  <p>But if i could set the seconds with a time picker will be better. Thanks</p>