0
我想要设置它以便进度条加载15秒,然后继续下一个活动。如何在android上设置延迟进度条
眼下的活动有:
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn5 =(Button)findViewById(R.id.button);
btn5.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Intent myIntent = new Intent();
myIntent.setAction(Intent.ACTION_VIEW);
myIntent.setData(android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
setContentView(R.layout.loading);
}
});
}
}
和XML页面有:
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="144dp"
android:layout_gravity="center_vertical" />
我想知道如何做出让progressBar1负荷15秒,然后去结果。 xml
代码已经完成了所有的“闪屏” Q&A的StackOverflow上看看,因为这是在行为上是相同的。最快的选项可能是在'Handler'上发布'Runnable',延迟15秒,然后开始你的第三个'Activity'。 – 2012-04-27 01:56:37
你可以做一个单独的线程来处理进度条,给线程所需的延迟,然后解除进度条... – Sandeep 2012-04-27 04:49:04