1.dialog点击外边关闭
public static Dialog creatDialog(final Context context,String tip){ Dialog dialog = new Dialog(context,R.style.appDialog); dialog.setContentView(R.layout.common_wdailog); dialog.setCanceledOnTouchOutside(false);// 设置点击屏幕Dialog不消失
2.dialog自定义尺寸
int width = ScreenUtils.getScreenHeight((Context) mainActInterface); getDialog().getWindow().setLayout(width * 2 / 3,LinearLayout.LayoutParams.WRAP_CONTENT); public static int getScreenHeight(Context context) { WindowManager wm = (WindowManager) context .getSystemService(Context.WINDOW_SERVICE); DisplayMetrics outMetrics = new DisplayMetrics(); wm.getDefaultDisplay().getMetrics(outMetrics); return outMetrics.heightPixels; }3.sqlite自增长
sqlite中创建自增字段:
自测有一些smallint 不能自增。