标签:android style blog io color os ar 使用 sp
<resources> <style name="Theme.SoundRecorder" parent="@android:style/Theme.Holo.DialogWhenLarge"> <item name="android:windowCloseOnTouchOutside">false</item> </style> </resources>
2,
YourActivity.this.setFinishOnTouchOutside(false);
二、如果API Level<11
@Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN && isOutOfBounds(this, event)) { return true; } return super.onTouchEvent(event); } private boolean isOutOfBounds(Activity context, MotionEvent event) { final int x = (int) event.getX(); final int y = (int) event.getY(); final int slop = ViewConfiguration.get(context).getScaledWindowTouchSlop(); final View decorView = context.getWindow().getDecorView(); return (x < -slop) || (y < -slop)|| (x > (decorView.getWidth() + slop))|| (y > (decorView.getHeight() + slop)); }
Activity使用Dialog样式导致点击空白处自动关闭的问题
标签:android style blog io color os ar 使用 sp
原文地址:http://www.cnblogs.com/longhs/p/4056918.html