I hope Android program to start automatically in the background, but the program itself has an active and Service, the program entry is active, how to let the boot interface automatically hide ah, as is my code, but active interface will be displayed. Hope expert guidance ah.
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 this tag, otherwise it will fail to start
context.startActivity (newIntent) ;/ /}
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Do not sink ah
Reply:
Guiqiu answer ah
Reply:
Wait for expert guidance ah
Reply:
Do not start the activity, you can start the service
Intent intent2 = new Intent (context, xxxService.class);
context.startService (intent2);
Reply:
Thank you, illustrated hjue, now there is a problem is that my activities there is a logical interface, ah, If you start service, then there is no logical interface to perform activities of how to do? Click on the icon to run because the normal case, starting from the active interface, activity in the logic interface can be implemented. Now how do?
Reply:
Entrance activity because there is a user interface logic to determine whether the registration, etc.
Reply:
All execute judgment into service inside.
Reply:
Yes, I try, thanked the first
Reply:
Boot only start service ah, activity can be displayed under certain conditions triggered Caesar
Reply:
Do not show activity can then set the display let main.xml does not show enough
Reply:
The landlord finally how to solve it
Reply:
I now want to call one another b.apk c in a.apk settings interface, but if b. apk not be started if the call is less than one, so I wanted to b. apk to start automatically, but they do not see b. apk interface, I do not know how to do, there is no good advice, if you want to use the service, the service in which things should be done?
Reply:
Landlord, hello. Android applications run this program you automatically boot 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
Reply:
I want to receive a Bluetooth message program runs in the background and do not know how to start?
Reply:
add me share what? ? 327704638
Reply:
add my advice, I need you to this technology 327,704,638
Reply:
Could Daniel have detailed point? How to set up a list of which services should inherit the service
No comments:
Post a Comment