<TextView
android:id="@+id/tv_nettime"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:gravity=“center”
android:text=“Hello World!”
android:textSize=“22sp” />
<Button
android:id="@+id/btn_nettime"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginTop=“20dp”
android:text=“获取当前网络时间”
android:textSize=“20sp” />
<Button
android:id="@+id/btn_localtime"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginTop=“20dp”
android:text=“获取当前系统时间”
android:textSize=“20sp” />
3.MainActivity.class主界面中的逻辑
package com.mythmayor.gettime;
<