Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8057513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:03:36+00:00 2026-06-05T09:03:36+00:00

when i am browsing in my app i get sometimes this error. I am

  • 0

when i am browsing in my app i get sometimes this error. I am not sure this error comes randomly and i can’t find out why. The Log doesn’t show anything specific to my application?

I hope someone could give me a tip or a hint why this error occoures. (The last time it came when i tried to open a popup, a Quickaction Dialog, after occouring a second time with the same Quickaction Dialog it worked again after i tried it a 3rd time. And now it works all the time, again?)

08-01 11:09:15.980: ERROR/AndroidRuntime(9579): FATAL EXCEPTION: main
08-01 11:09:15.980: ERROR/AndroidRuntime(9579): java.lang.NullPointerException
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at android.widget.PopupWindow$PopupViewContainer.dispatchKeyEvent(PopupWindow.java:1445)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2664)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at android.view.ViewRoot.deliverKeyEvent(ViewRoot.java:2629)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1935)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at android.os.Looper.loop(Looper.java:143)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at android.app.ActivityThread.main(ActivityThread.java:4196)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at java.lang.reflect.Method.invokeNative(Native Method)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at java.lang.reflect.Method.invoke(Method.java:507)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-01 11:09:15.980: ERROR/AndroidRuntime(9579):     at dalvik.system.NativeStart.main(Native Method)

Here some more details:

QuickAction qa = QuickactionBuilder.showSaveForgetQuickaction();

                qa.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
                    @Override
                    public void onItemClick(int pos) {
                        if (pos == 0) { // SAVE
                            Toast.makeText(ctxHolder.getCtx(), "TODO SAVE", Toast.LENGTH_SHORT).show();
                        } else if (pos == 1) { // REJECT
                            Toast.makeText(ctxHolder.getCtx(), "REJECTED", Toast.LENGTH_SHORT).show();
                        } else { // CANCEL
                            Toast.makeText(ctxHolder.getCtx(), "CANCEL", Toast.LENGTH_SHORT).show();
                        }
                    }
                });

                qa.show(v);

THe QuickactionBuilder only creates the QuickAction Dialog for me.
That’s as simple as:
(Only to show the basics of that method)

QuickAction qa = new QuickAction
ActionItem ai = new ActionItem() 
// some setters ...

qa.add(ai)

return qa;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:03:37+00:00Added an answer on June 5, 2026 at 9:03 am

    I had the same problem with QuickAction
    i received crashes from users although i couldn’t reproduce them on my devices
    so if anyone still needs the solution i’d be glad to share it

    the idea is to avoid of using PopupViewContainer in PopupWindow because the crash bug is in its dispatchKeyEvent(KeyEvent event) method. The only way i could do that is to keep backgroundDrawable == null. Then you have to handle outside touches and Back button yourself.

    PopupWindows Class:

    public PopupWindows(Context context) {
        mContext    = context;
    
        mWindow     = new PopupWindow(context);
        mWindow.setBackgroundDrawable(null);
        ......
    }
    
    protected void onShow() {   
    
        if (mRootView == null) {
            return;
        }
    
        if (mRootView instanceof CustomRelativeLayout) {
            ((CustomRelativeLayout)mRootView).setDispatchKeyEventListener(new CustomRelativeLayout.OnDispatchKeyEventListener() {
    
                @Override
                public void onDispatchKeyEvent(KeyEvent event) {
                    if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 && mWindow.isShowing()) {
                        dismiss();
                    }
                }
            });
        }       
    
        mRootView.setOnTouchListener(new View.OnTouchListener() {
    
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                if (event.getAction() == MotionEvent.ACTION_DOWN && mWindow.isShowing()) {
                    dismiss();
                    return true;
                }
                return false;
            }
        });
    
    }
    

    Do not set any drawable here:

    protected void preShow() {
        if (mRootView == null) 
            throw new IllegalStateException("setContentView was not called with a view to display.");
    
        onShow();
    
        mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
        mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        mWindow.setTouchable(true);
        mWindow.setFocusable(true);
        mWindow.setOutsideTouchable(true);
    
        mWindow.setContentView(mRootView);
    }
    

    And everything next is classic

    CustomRelativeLayout:

    public class CustomRelativeLayout extends RelativeLayout {
    
    public CustomRelativeLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    
    public CustomRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    
    public CustomRelativeLayout(Context context) {
        super(context);
    }
    
    private OnDispatchKeyEventListener mOnDispatchKeyEventListener;
    
    
    
    public void setDispatchKeyEventListener(OnDispatchKeyEventListener listener) {
        mOnDispatchKeyEventListener = listener;
    }
    
    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        if (mOnDispatchKeyEventListener != null) {
            mOnDispatchKeyEventListener.onDispatchKeyEvent(event);
        }
        return super.dispatchKeyEvent(event);
    }
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return super.onTouchEvent(event);
    }   
    
    public static interface OnDispatchKeyEventListener {
        public void onDispatchKeyEvent(KeyEvent event);
    }
    }
    

    popup_vertical.xml and popup_horizontal.xml:

    just use com.your.package.CustomRelativeLayout instead of top level RelativeLayout

    Hope this will help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can I fire the default app for file browsing on Android >= API
I have this App that uses the Webbrowser control to do automated browsing. I
browsing some html code I find a text input coded as: <input type=text name=Email<%=orderRow.ID
While browsing I came across this blog post about using the Wikipedia API from
While browsing MSDN documentation, you may come across this gem: TextBox.Watermark. Awesome! I've been
While browsing SO I sometimes see EOFD for example: ftp -vn <$hostname> <<EOFD Yes
I have been trying to develop an app for my ipad which i can
Using the facebook graph you can get photo information as follows: https://graph.facebook.com/20531316728 However the
I'm currently developping a database browsing app using Qt & C++. The databases are
There must be a simple solution to this, but after 4 hours of browsing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.