<TextView
android:id="@+id/texttime3"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="00:00"/>
MainActivity:
private TextView mTextView2;
mTextView2 = (TextView) findViewById(R.id.texttime3);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");// HH:mm:ss
//获取当前时间
Date date = new Date(System.currentTimeMillis());
mTextView2.setText(simpleDateFormat.format(date));
需要注意的是,运行时使用真机运行