Can't call a method through broadcastReceiver

view story

http://stackoverflow.com – I am trying to call a method (postMessage) through a broadcastReceiver by Passing the context but is not working. What is the mistake ? I tried many things but still not working. public class AlarmReceiver extends BroadcastReceiver implements OnActivityResultListener { public void onReceive(Context context, Intent intent) { try { controler(context); } catch (Exception e) { Toast.makeText( context, "There was an error somewhere", Toast.LENGTH_SH (HowTos)