我创建了一个带有进度条的简单对话框,问题是进度条返回空值,我想知道为什么
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Dialog dialog =new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.row_download);
dialog.show();
ProgressBar progressBar = (ProgressBar) findViewById(R.id.row_download_progressBar1);
TextView progressTextView = (TextView) findViewById(R.id.row_download_progress);
Log.v("", ""+progressBar);
}
}
虽然我在
dialog.setContentView(R.layout.row_download);