100*_*abh 4 android progressdialog
我正在使用我的一项活动中的以下代码来开始另一项活动
Intent viewIntent = new Intent(getApplicationContext (), landingPage.class);
Bundle b = new Bundle();
b.putString("ApplicationName", a_Bean.getApplicationName());
if (landingPage.getInstanceCount() < 1)
bp.landingPage_ProgressDialog = ProgressDialog.show(ViewAllApp.this, "Please wait...", "Retrieving data...", true, false);
viewIntent.putExtras(b);
viewIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivityForResult(viewIntent,10);
Thread background = new Thread(new Runnable() {
public void run() {
Progresshandler.sendMessage(handler.obtainMessage());//finishes progressDialog
}});
background.start();
Run Code Online (Sandbox Code Playgroud)
但是在 startactivity 之后它会显示一个黑屏然后显示新的活动。我可以在显示黑屏时显示进度对话框吗?
这对我有用:
Intent intent = new Intent(LocationGrid.this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
overridePendingTransition(0, 0);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10785 次 |
| 最近记录: |