sendUserActionEvent() returned
Asked Answered
G

2

46

I got the following error when a popup dismisses using android studio. The code works OK, but the following error appears on logcat:

E/ViewRootImpl: sendUserActionEvent() returned.

java code:

LayoutInflater layoutInflater = getLayoutInflater();
View popupView = layoutInflater.from(getActivity()).inflate(R.layout.dayview_popup,null);
popupWindow = new PopupWindow(popupView, Toolbar.LayoutParams.MATCH_PARENT, Toolbar.LayoutParams.WRAP_CONTENT,true);
popupWindow.setOutsideTouchable(true);

....

int[] loc_int = new int[2];
try {
    view.getLocationOnScreen(loc_int);
} catch (NullPointerException npe) {}

Rect location = new Rect();
location.left = loc_int[0];
location.top = loc_int[1];
location.right = location.left + view.getWidth();
location.bottom = location.top + view.getHeight();

popupWindow.setAnimationStyle(R.style.Animation);
popupWindow.showAtLocation(view, Gravity.TOP|Gravity.RIGHT, location.right, location.bottom);

View container = (View) popupWindow.getContentView().getParent();
WindowManager wm = (WindowManager) cntx.getSystemService(Context.WINDOW_SERVICE);
WindowManager.LayoutParams p = (WindowManager.LayoutParams) container.getLayoutParams();
p.flags |= WindowManager.LayoutParams.FLAG_DIM_BEHIND;
p.dimAmount = 0.7f;
wm.updateViewLayout(container, p);
Grandiose answered 29/8, 2018 at 16:17 Comment(3)
Not sure, but see if this helps:medium.com/@WeselyOng/… or #56476927Gynous
Does this answer your question? sendUserActionEvent() is nullBetook
Check this #56476927Danilodanio
T
1

You can try deleting the code and writing it again. May be Cut, close project, open project and paste that section back.

Twobyfour answered 4/5, 2020 at 10:12 Comment(0)
H
0

This is more likely the issue with the device rather than the app. Your app is fine. Similar issue was raised before: sendUserActionEvent() is null

Thanks.

Hortensiahorter answered 2/5, 2020 at 10:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.