vendredi 6 mars 2015

Attempting to Invoke virtual method 'android.view.Window.getLayoutInflater()' on a null object



I am trying to get my app to open to a specific webpage. However, when the button is clicked, the app crashes and throws the following error:


java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.LayoutInflater android.view.Window.getLayoutInflater()' on a null object reference



@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_schedule, menu);
return true;
}


The layout that is called is not null and it exists. What is the problem?




Aucun commentaire:

Enregistrer un commentaire