How to keep Popup window opened when orientation changes at run time in Android?

前端 未结 4 1981
夕颜
夕颜 2020-12-19 07:12

I have created a Popup window which contains month view to pick up date. When I changes orientation, due to Android loads an activity all over again my popup Window gets dis

4条回答
  •  心在旅途
    2020-12-19 07:42

    Showing PopupWindow as

    final View parent = findViewById(R.id.{parentId});
    parent.post(new Runnable() {
        @Override
        public void run() {
            mPopup.showAtLocation(parent, ...);
        }
    });
    

    resolves unhandled exception on orientation change

提交回复
热议问题