1

NullPointerException when call a mehtod from BroadcastReceiver to Activity?

view story
linux-howto

http://stackoverflow.com – I need to call a method from BroadcastReceiver and method exist in the Activity class. I tried this code and got NULL_POINTER_EXCEPTION. Correct me what I'm doing wrong ? MainActivity.java public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void myTesting(){ Toast.makeText(MainActivity.this, "Welcome to Activity", Toast.LENGTH_SHORT).show(); } } BroadcastReceiver.java public class BootCompeteReceiver extends BroadcastReceiver { public (HowTos)