これは、src にある私の .java ファイルです。
package com.wao.texttime;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class TextTime extends Activity {
/** Called when the activity is first created. */
@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 に、時間に応じて異なるテキストを表示させたいと考えています。F.ex。08:45 ~ 10:45 など。私はAndroidとJavaの両方でコーディングするのが初めてで、表示するテキストのルールをどのように作成できるかを理解しようとしています. 何か提案はありますか?