ProgressBar用于显示进度条,表示我们的程序正在加载数据
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/but"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="点击"/>
<ProgressBar
android:id="@+id/ProgressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
MainActivity.java:
package com.example.boring2;
import android.app.ProgressDialog;
import android.content.Intent;
import android