public void onReceive (Context context, Intent intent) {
if (intent.getAction (). equals (Intent.ACTION_BOOT_COMPLETED)) {
Intent newIntent = new Intent (context, WelcomeActivity.class);
newIntent.setAction ("android.intent.action.MAIN");
newIntent.addCategory ("android.intent.category.LAUNCHER");
newIntent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK) ;/ / Note that you must add the mark, otherwise will fail to start
context.startActivity (newIntent) ;/ /}
------ Solution -------------------------- ------------------
do not start the activity, you can start the service
Intent intent2 = new Intent(context,xxxService.class);
context.startService(intent2);
------ Solution ------------------------------------- -------
all into service inside the execution judge.
------ Solution ---------------------------------------- ----
boot only start service ah , activity can be triggered under certain conditions show sprinkle
------ eference ---------------- -----------------------
not sink ah
------ eference ---------- -----------------------------
Guiqiu answer ah
------ eference ---- -----------------------------------
wait for expert guidance ah
----- - eference ---------------------------------------
Thank you, illustrated hjue, now problem is that my activities in a logical interface , ah, If you start service, then the active interface logic does not execute how to do ? Click the icon to run as normal , then start from the active interface , the logical interface in activity can be performed . Now how to do ?
------ eference --------------------------------------- < br> import activities because there are user interface registration, etc. the logic judgment
------ eference ----------------------- ----------------
well, I try, thanked the first
------ eference ----------- ----------------------------
activity does not appear you can set the display and then let main.xml does not display enough the
------ eference ------------------------------------- -
landlord finally how to solve it
------ eference ------------------------- --------------
I am going to call another b.apk a.apk a setup interface c, but if b. apk without first initiating a call if less , so I want to b. apk automatically start , but they do not see b. apk interface, do not know how to do , there is no good advice , if you want to use the service , the service in what things should be done ?
------ eference --------------------------------------- < br> landlord, hello . Android application boot automatically run this program you somehow, I now need to run an Android application , go and get really do not know . I hope you can give pointers , thank you. Contact : tqvstf@qq.com
Who knows , I hope advice , thank you
------ eference ------------------- --------------------
I want a Bluetooth message to receive a program running in the background and do not know how to start ?
------ eference --------------------------------------- < br> add me exchange it ? ? 327704638
------ eference ---------------------------------------
add my advice, I need you to this technique 327704638
------ eference --------------------------- ------------
large cattle can elaborate it ? How to set up a list inside the service should inherit that service
没有评论:
发表评论