XML File [Link].
AppCompatActivity;
import [Link];
<?xml version="1.0" encoding="utf-8"?>
import [Link];
<RelativeLayout
import
xmlns:android="[Link]
[Link];
apk/res/android"
public class MainActivity extends
xmlns:app="[Link]
AppCompatActivity {
res-auto"
TextView time;
TimePicker simple;
xmlns:tools="[Link]
ls"
@Override
android:id="@+id/main"
protected void onCreate(Bundle
android:layout_width="match_parent"
savedInstanceState) {
android:layout_height="match_parent"
[Link](savedInstanceState);
tools:context=".MainActivity">
[Link](this);
<TimePicker
setContentView([Link].activity_main);
android:id="@+id/simple"
time=findViewById([Link]);
android:layout_width="wrap_content"
simple=findViewById([Link]);
android:layout_height="wrap_content"
simple.setIs24HourView(false);
android:layout_centerHorizontal="true"
[Link](new
android:layout_marginTop="120dp"
[Link]() {
android:timePickerMode="spinner"/>
@Override
public void onTimeChanged(TimePicker
<TextView
view, int hourOfDay, int minute) {
android:id="@+id/time"
int hourOfday = 0;
android:layout_width="wrap_content"
android:layout_height="wrap_content"
[Link](getApplicationContext(),hour
android:text="Time is ="
Ofday+" "+minute,
android:layout_marginTop="100dp"
Toast.LENGTH_SHORT).show();
android:textSize="20dp"
[Link]("Time
android:layout_marginLeft="100dp"
is:"+hourOfDay+":"+minute);
/>
}
});
</RelativeLayout>
Activity File }
}
package [Link].prac15;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import
OUTPUT