I am trying to display the options menu when a list item is checked in my app. I am doing this by broadcasting an intent when the checkbox is clicked via a listener and a helper class that extends Activity. My code for the helper class is such:
public class menuHelper extends Activity{
private void showMenu(int checked){
try{
Intent intent = new Intent(SHOW_MENU);
intent.putExtra("check", checked);
sendBroadcast(intent);
}catch(Exception e){ e.printStackTrace(); } }
}
The problem is when the sendBroadcast method is invoked. An exception is thrown and the stack trace states that it is a NullPointerException at sendBroadcast(intent). As far as I can tell, the intent is not null but I am missing something here because the exception is thrown. Any help is appreciated!