私はAndroid開発とJavaに不慣れなPHP開発者ですので、ご容赦ください。
私はテストと学習の目的で非常にシンプルなアプリを開発しています。
ユーザーが私のアプリアイコンをクリックすると、ロード画面が表示されます。下にプログレスバーのあるTextViewがあります。
TextView XMLコード:
<TextView
android:id="@+id/loadingMessage1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/progressBar1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="22dp"
android:text="@string/loading1" />
値はstrings.xmlの文字列loading1に設定されます
<string name="loading1">Loading Message 1</string>
私のloadingscreen.javaには、次のものがあります。
package com.example.myfirstapp;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;
public class LoadingScreen extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loading_screen);
TextView loadingMessage1 = (TextView)this.findViewById(R.id.loadingMessage1);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_loading_screen, menu);
return true;
}
}
私がコードを持っていることに注意してください:
TextView LoadingMessage1 =(TextView)this.findViewById(R.id.loadingMessage1);
これはテキストビューを参照していると思います。
私がしたいのは、3秒ごとに異なるメッセージが表示されることです。
したがって、メッセージ1をロードしています...(3秒)メッセージ2をロードしています...(3秒)メッセージ3をロードしています。
メッセージ3を読み込んだ後、プログレスバーを置き換えるボタンが欲しいのですが。