Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Attempt to invoke virtual method 'boolean com.devspark.appmsg.AppMsg.isShowing()' on a null object reference #36

Open
gyanminda opened this issue Aug 4, 2015 · 1 comment

Comments

@gyanminda
Copy link

Hi, I have created two AppMsg object like below,

public MyActivity extends Activity {
     AppMsg noConnectionMsg, connectedMsg; 

    @Override
    public void onCreate(Bundle bundle) {
      noConnectionMsg = AppMsg.makeText(this,
                getResources().getString(R.string.msgNoConnection),
                AppMsg.STYLE_ALERT);

        noConnectionMsg.setDuration(AppMsg.LENGTH_STICKY);


        connectedMsg = AppMsg.makeText(this,
                getResources().getString(R.string.msgConnected),
                AppMsg.STYLE_INFO);
    }

   ...
   ...

}

But when I run the application, notifications are successfully shown. After cancelling the AppMsgs, App is getting crashed with this Error:

Attempt to invoke virtual method 'boolean com.devspark.appmsg.AppMsg.isShowing()' on a null object reference.

@rcrepaldi
Copy link

Only a null check would solve the problem. I see that this library is abandoned by the date of the problem and the neglect of the question. My solution was to download the library and do the null treatment in the class MsgManager.java line: 172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant