In my application there are two buttons. One will show start time and the second one will show the stop time when it's clicked. I need to get those two values, calculate the difference and multiply it by another value. Here is how i set value to one of the labels:
if (v == btnstart) {
Toast.makeText(getApplicationContext(), "Work Start", Toast.LENGTH_LONG).show();
Date d=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("hh:mm a");
String currentDateTimeString = sdf.format(d);
txtstart.setText(currentDateTimeString);
}