android在执行程序过程中,很可能会用到,正在执行的提示.下面我们就自己做一个提示框,自带蒙板,执行过程中,后面的窗口内容不能操作.
下面的代码可以直接复制粘贴使用:
1.首先写一个WaitDialog类:
import android.app.Dialog;import android.content.Context;import android.view.Gravity;import android.view.LayoutInflater;import android.view.View;import android.view.Window;import android.view.WindowManager;import android.widget.LinearLayout;import android.widget.TextView;import com.baidu.idl.main.facesdk.gatelibrary.R;public class WaitDialog {Dialog loadingDialog = null;String msg = "";Context context = null;TextView tipTextView;private WaitDialog(Context context, String msg) {this.context = context;this.msg = msg;LayoutInflater inflater = LayoutInflater.from(context);View v = inflater.inflate(R.layout.dialog_loading, null);// 得到加载viewLinearLayout layout = (LinearLayout) v.findViewById(R.id.dial