I want to compare system time and user input time , i am comparing but i dont know its right or wrong statement because if(check) is not running here is my code
c = Calendar.getInstance();
SimpleDateFormat df1 = new SimpleDateFormat(" hh:mm a");
String strdate = df1.format(c.getTime());
Toast.makeText(getApplicationContext(), strdate , Toast.LENGTH_LONG).show();
Above Toast line showing the current time of system i.e. 04:50 AM
Toast.makeText(getApplicationContext(), prayerTimes.get(0) , Toast.LENGTH_LONG).show();
this toast line showing the timing of user input i.e. 06:30 AM
if(strdate ==prayerTimes.get(0))
{
Intent in = new Intent(MainActivity.this, Dialog.class);
startActivity(in);
finish();
Toast.makeText(getApplicationContext(), "yahoo", Toast.LENGTH_LONG).show();
}
When both times will be same IF Check not work...Please help me how i can compare both times???