Skip to content

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

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions