0

Am using Edit text inside the popup window after am enter the values in edit text it shows some bad token error.Can any one know please help me to solve this issue.

My Pop up window Coding.

 inflater1 = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                popupView = inflater1.inflate(R.layout.image_pop_up, null, true);
                pw = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
                pw.setFocusable(true)
    EditText name = (EditText)popupView.findViewById(R.id.edittext1);
    pw.showAtLocation(activity.findViewById(R.id.order_page_xml), Gravity.CENTER, 0, 15);

my log-cat error is

05-11 17:44:05.381: E/AndroidRuntime(1558): android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@4169cf30 is not valid; is your activity running?
05-11 17:44:05.381: E/AndroidRuntime(1558):     at android.view.ViewRootImpl.setView(ViewRootImpl.java:513)
05-11 17:44:05.381: E/AndroidRuntime(1558):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:301)
Shruti
  • 1
  • 13
  • 55
  • 95
Yugesh
  • 4,030
  • 9
  • 57
  • 97

0 Answers0