마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

상단바 사용막을것을 다시 사용할 수 있도록 하는 방법???

0 추천

막는 소스는 다음과 같습니다..

구글링해서 나온것이라서  막는것을 성공했으나..

마지막에 막은것을 풀고 싶은데.. 방법을 모르겠습니다..ㅠㅠㅠ

manager = ((WindowManager) getApplicationContext()
	            .getSystemService(Context.WINDOW_SERVICE));

		WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams();
		localLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
		localLayoutParams.gravity = Gravity.TOP;
		localLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|

	            // this is to enable the notification to recieve touch events
	            WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |

	            // Draws over status bar
	            WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;

	    localLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
	    localLayoutParams.height = (int) (50 * getResources()
	            .getDisplayMetrics().scaledDensity);
	    localLayoutParams.format = PixelFormat.TRANSPARENT;

	    view = new customViewGroup(this);

	    manager.addView(view, localLayoutParams);
public class customViewGroup extends ViewGroup {

	public customViewGroup(Context context) {
		super(context);
	}

	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
	}

	@Override
	public boolean onInterceptTouchEvent(MotionEvent ev) {
		Log.v("customViewGroup", "**********Intercepted");
		return true;
	}
}

 

쿠쿠부다스 (6,470 포인트) 님이 2017년 3월 21일 질문

1개의 답변

0 추천
 
채택된 답변
onInterceptTouchEvet 안에 return 값을 false 로 하면 풀리고 true로하면 막힐꺼같은데요

return값 변경시켜줄 메소드 하나 만들어서 해주면 될꺼에요
페어리 (12,270 포인트) 님이 2017년 3월 21일 답변
쿠쿠부다스님이 2017년 3월 22일 채택됨
...