android的提示页面,android 页面加载中,友情提示界面-Fun言
先是布局頁面
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:orientation="vertical" >
android:id="@+id/myButton1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
android:id="@+id/myTextView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
再 是主 activity
package sql.com;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class SqlActivity extends Activity
{
private Button mButton1;
private TextView mTextView1;
public ProgressDialog myDialog = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mButton1 =(Button) findViewById(R.id.myButton1);
mTextView1 = (TextView) findViewById(R.id.myTextView1);
mButton1.setOnClickListener(myShowProgressBar);
}
Button.OnClickListener myShowProgressBar = new Button.OnClickListener()
{
public void onClick(View arg0)
{
final CharSequence strDialogTitle = "請稍等";
final CharSequence strDialogBody = "數據讀取中 . . . .";
// 顯示Progress對話框
myDialog = ProgressDialog.show
(
SqlActivity.this,
strDialogTitle,
strDialogBody,
true
);
mTextView1.setText(strDialogBody);
new Thread()
{
public void run()
{
try
{
/*在這里寫上要后臺運行的代碼段 */
/* 為了明顯看見效果,以暫停3秒作為示范*/
sleep(3000);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
// 卸載所創建的myDialog對象
myDialog.dismiss();
}
}
}.start(); /* 開始運行線程 */
} /*End: public void onClick(View arg0)*/
};
}
自定義 字體顏色
1, 現在 ?在 res/values/styles.xml ?寫入
@android:color/transparent
#ff0000
然后在 T3Activity.java 中
public class T3Activity extends Activity {
/** Called when the activity is first created. */
ProgressDialog myDialog;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// 每次使用需要調用如下, 進行 new 一下 , ----
myDialog = new ProgressDialog(T3Activity.this, R.style.myDialog);//加載style
myDialog.setMessage("sss");
myDialog.show();
// =============================================
//OK 之后只需 dismiss();
myDialog.dismiss();
}
}
總結
以上是生活随笔為你收集整理的android的提示页面,android 页面加载中,友情提示界面-Fun言的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: adt+选择android+sdk,ec
- 下一篇: html5 canvas获取坐标系,HT