title: Issues in getting the time from timePicker and check it with the current time
body: <p>I did a small android application which is about taking time from the user by timePicker and if the chosen time is same as the current one, the application sends you a notification. This is the code that I wrote on android studio :</p>
  
  <pre><code>public Button mb;
  public EditText editText;
  public Button pb;
  int i=0;
  
  public void showMotivation(){
  
      mb = (Button)findViewById(R.id.mb);
      editText = (EditText)findViewById(R.id.editText);
  
      mb.setOnClickListener(
              new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      editText.setText(MotivationWords());
                  }
              }
      );
  
  }
  
  public String MotivationWords(){
  
      Random rnd = new Random();
      List l = new LinkedList&lt;&gt;();
      l.add("The price of excellence is discipline; the cost of mediocrity is disappointment.");
      l.add("If we had no winter, the spring would not be so pleasant; if we did not sometimes taste of adversity, prosperity would not be so welcome.");
      l.add("If your ship doesn’t come in, swim out to it!");
      l.add("Tomorrow will be a better day ..");
      l.add("Life’s not about waiting for the storms to pass... it’s about learning to dance in the rain.");
      l.add("When you reach the end of your rope, tie a knot in it and hang on.");
      l.add("A smooth sea never made a skilled mariner.");
      l.add("Great masters merit emulation, not worship.");
      l.add("Confidence is contagious. So is the lack of confidence.");
      l.add("Optimism may sometimes be delusional, but pessimism is always delusional.");
  
      i=rnd.nextInt()%9;
  
      return l.get(i).toString();
  
  
  }
  
  public void changing(){
  
      pb = (Button)findViewById(R.id.pb);
      pb.setOnClickListener(
              new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                      Intent intb = new Intent(MainActivity.this, Main2Activity.class);
                      startActivity(intb);
                  }
              }
      );
  
  }
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      changing();
      showMotivation();
  }
  </code></pre>