I am trying to run my method when my assigned time is the same as system time. I am sure that both calendar printout the same result but it doesn't run the method.
public class Intake extends Fragment {
TextView tv1, tv2,tv3;
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState){
return inflater.inflate(R.layout.intake, container, false);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState){
tv1 = (TextView) getActivity().findViewById(R.id.tv1);
tv2 = (TextView) getActivity().findViewById(R.id.tv2);
tv3 = (TextView) getActivity().findViewById(R.id.tv3);
Calendar settime = Calendar.getInstance();
settime.set(Calendar.HOUR_OF_DAY, 10);
settime.set(Calendar.MINUTE,46);
settime.set(Calendar.SECOND,10);
Calendar systime = Calendar.getInstance();
systime.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String aa = String.valueOf((sdf.format(settime.getTime())));
String bb = String.valueOf((sdf.format(systime.getTime())));
tv1.setText(aa);
tv2.setText(bb);
if (aa == bb){
runMath();
}
}
}
THank you