设置Toast变量,判断是否存在.
private static Toast mToast;
public static void show(Context ctx, String text) {
if (mToast == null) {
mToast = Toast.makeText(ctx, text, Toast.LENGTH_SHORT);
} else {
mToast.setText(text);
}
mToast.show();
}
对type/flag的值设定.
WindowManager mWM; // WindowManager
WindowManager.LayoutParams mWMParams; // WindowManager参数
wmParams.type = 2003; // type是关键,这里的2002表示系统级窗口,你也可以试试2003。
wmParams.flags = 40;// 这句设置桌面可控
mWM.addView(win,wmParams);// 这句是重点 给WindowManager中丢入刚才设置的值只有addview后才能显示到页面上去。
// 注册到WindowManager win是要刚才随便载入的layout,wmParams是刚才设置的WindowManager参数集效果是将win注册到WindowManager中并且它的参数是wmParams中设置.
ProgressBar --> View:利用帧动画可实现不停的旋转;android:indeterminateDrawable="@anim/progress_bar_anim";也可以继承ProgressBar,利用RotateAnimation实现旋转;
The application can change the amount of progress (modifying the length of the bar) as it moves forward.
The indeterminate progress bar can be either a spinning wheel or a horizontal bar.
SeekBar --> AbsSeekBar --> ProgressBar --> View:A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys.