I am planning on having an activity with two check boxes. I want to do some tasks when the screen is off in the background continuously based on what the user check marks.
final CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox_id);
if ( checkBox1.isChecked() && myServiceIsntRunning() ) {
startService(myService1.class)
if ( checkBox2.isChecked() && myService2IsntRunning() ) {
startService(myService2.class)
}
If both the checkmarks are checked, I wan't both tasks to constantly run in the background forever using this method. Is there any harm in launching both services at once? There doesn't appear to be any documentation about it in the Optimization tips documentation, and I saw this page about it: Can start 2 services from the same activity and can run that activity and two services parrallely in android?. So, would starting two services parallely forever be a good idea?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…