开发者

Android 2.2: Autostart application on boot problem

@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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜