这是我的按钮活动的代码,我设法添加了一个进度对话框,所以当活动科学技术正在加载它的显示加载时......只是它没有旋转,所以我想知道我做错了什么,也许有人可以寻找我的错误这是代码:
package net.thinkbin;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
public class tutorial1 extends Activity{
private ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
setContentView(R.layout.tutorial1);
Button share = (Button) findViewById(R.id.button2);
share.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("net.thinkbin.SHARE"));
overridePendingTransition(0, 0);
finish();
}
});
Button menu = (Button) findViewById(R.id.buttonhome);
menu.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading...");
Thread th = new Thread(new Runnable() {
public void run(){
startActivity(new Intent("net.thinkbin.MENU"));
overridePendingTransition(0, 0);
progressDialog.dismiss();
finish();
}
});
th.start();
}
});
Button culture = (Button) findViewById(R.id.button3);
culture.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading...");
Thread th = new Thread(new Runnable() {
public void run(){
startActivity(new Intent("net.thinkbin.CULTURE"));
overridePendingTransition(0, 0);
progressDialog.dismiss();
finish();
}
});
th.start();
}
});
Button entertainment = (Button) findViewById(R.id.button4);
entertainment.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading...");
Thread th = new Thread(new Runnable() {
public void run(){
startActivity(new Intent("net.thinkbin.ENTERTAINMENT"));
overridePendingTransition(0, 0);
progressDialog.dismiss();
finish();
}
});
th.start();
}
});
Button philosophy = (Button) findViewById(R.id.button5);
philosophy.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading...");
Thread th = new Thread(new Runnable() {
public void run(){
startActivity(new Intent("net.thinkbin.PHILOSOPHY"));
overridePendingTransition(0, 0);
progressDialog.dismiss();
finish();
}
});
th.start();
}
});
Button sciencetechnology = (Button) findViewById(R.id.button6);
sciencetechnology.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading...");
Thread th = new Thread(new Runnable() {
public void run(){
startActivity(new Intent("net.thinkbin.SCIENCETECHNOLOGY"));
overridePendingTransition(0, 0);
progressDialog.dismiss();
finish();
}
});
th.start();
}
});
}
}