我用谷歌搜索了很多,甚至解决了这个网站的许多问题,但我就是找不到解决问题的方法。
我想创建一个如下所示的进度对话框。但我不明白该怎么做..我尝试过创建一个自定义进度对话框但是..你只能修改内部微调器外观..在我的如果我想修改它的布局...我怎样才能实现...????
到目前为止,我已经尝试了以下...
public class nextclass extends Activity {
Thread t;
ProgressBar dia;
private ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
MainActivity.progressDialog.dismiss();
setContentView(R.layout.nextclassview);
// requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
((Button) findViewById(R.id.button1))
.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
// progressDialog = findViewById(R.id.progressBar1);
new AuthenticateUserTask().execute();
}
});
}
private class AuthenticateUserTask extends AsyncTask<Void, Void, String> {
@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
progressDialog = ProgressDialog.show(
nextclass.this, "","Sucessful", true);
/* progressDialog.setIndeterminate(true);
progressDialog.setIndeterminateDrawable(getResources()
.getDrawable(R.layout.customspinner));
*/
progressDialog = ProgressDialog.show(nextclass.this, "",
"Processing....", true);
progressDialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
}
protected void onPostExecute(String s) {
if (progressDialog.isShowing())
progressDialog.dismiss();
Intent my = new Intent(getApplicationContext(), CountTime.class);
startActivity(my);
}
@Override
protected String doInBackground(Void... params) {
// TODO Auto-generated method stub
try {
Thread.sleep(2000);![custom spinner][2]
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
}