Keeping track of View added to WindowManager (no findViewById() function?)

后端 未结 4 2088
无人及你
无人及你 2020-12-29 06:50

In my service I add a view to WindowManager with addView(). When I\'m ready to hide the view, I call removeView() using the View

4条回答
  •  悲&欢浪女
    2020-12-29 07:03

    You can also use:

    ViewCompat.isAttachedToWindow(mView);
    

    According the docs:

    Returns true if the provided view is currently attached to a window.

提交回复
热议问题