Messenger messenger ;
boolean isBound = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void bindService(View view){
Intent intent = new Intent(this,MyService.class);
bindService(intent, serviceConnection, BIND_AUTO_CREATE);
}

public void sayHello(View view){
String button_text;
button_text = (String)((Button)view).getText();
if (button_text.equals("SAY HELLO")) {
Message message = Message.obtain(null, MyService.JOB_1, 0, 0, 0);
try {
messenger.send(message);
} catch (RemoteException e) {
e.printStackTrace();
}
}
else if (button_text.equals("SAY HELLO AGAIN")){
Message message = Message.obtain(null,MyService.JOB_2,0,0,0);
try {
messenger.send(message);
} catch (RemoteException e) {
e.printStackTrace();
}
}
else
Toast.makeText(getApplicationContext(),"Bind Service first",Toast.LENGTH_LONG).show();
}

error:
 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Messenger.send(android.os.Message)' on a null object reference