I have the following error when showing a PopupWindow. The errors are triggered by the line:
checkInPopup.showAtLocation((ViewGroup) mapView.getParent(), Gra
Try to show the pop like below
findViewById(R.id.main_layout).post(new Runnable() {
public void run() {
mPopupWindow.showAtLocation(findViewById(R.id.main_layout), Gravity.CENTER, 0, 0);
Button close = (Button) customView.findViewById(R.id.btn_ok);
close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPopupWindow.dismiss();
doOtherStuff();
}
});
}
});