First, say service services.
1. Use the Setaction () method to specify the service services to be started
1 New Intent (); 2 intent.setaction ("serviceaction"); 3 StartService (intent);
2. Add activity content using Intent's constructor class
1 New Intent ("Serviceaction"); 2 StartService (intent);
3, and activity between jump similar
1 New Intent (mainactivity. this, servicetest. class ); 2 StartService (intent);
Second, see broadcast broadcast
1. Use the Setaction () method to specify the broadcast broadcast to be sent
1 New Intent (); 2 intent.setaction ("broadcastaction"); 3 Sendbroadcast (intent);
2. Add activity content using Intent's constructor class
1 New Intent ("Broadcastaction"); 2 Sendbroadcast (intent);
3, and activity between jump similar
1 New Intent (mainactivity. this, broadcasttest. class ); 2 Sendbroadcast (intent);
Common methods for Android to start service services and send broadcast broadcasts