@Override
public void onReceive(Context context, Intent intent) {
Intent myIntent = new Intent(context, YourActivity.class);
context.startActivity(myIntent);
}
I have made a class that extends BroadCastreciever. I want it to run my main class on startup, but i keep getting the "force close" message when i boot my device. I think the problem is located at "YourActivity.class".
I have tried with "TestMain.class" (my main class name) and "com.test.Testmain.Cl开发者_JAVA技巧ass". Did i miss something?
Thanks
I would follow this example if you want to start it up on boot up.
Auto Start app
精彩评论