这是要实现的代码:
package com.wao.texttime;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class TextTime extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv1 = (TextView) findViewById(R.id.TextView01);
tv1.setText("Good Morning");
TextView tv2 = (TextView) findViewById(R.id.TextView02);
tv1.setText("Good Afternoon");
}
}
我想在TextView根据时间来显示不同的文本。比如在08:45-10:45之间显示什么文本等等。请问有什么好的建议吗?