forked from jens/Automation
Battery charging type differentiation and other fixes
This commit is contained in:
@@ -526,15 +526,23 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
{
|
||||
if (Rule.getRuleCollection().size() > 0)
|
||||
{
|
||||
if(Rule.getAmountOfActivatedRules() == 0)
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.serviceWontStartNoActivatedRules), Toast.LENGTH_LONG).show();
|
||||
activityMainScreenInstance.toggleService.setChecked(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AutomationService.isMyServiceRunning(context))
|
||||
{
|
||||
// if(myServiceIntent == null) //do we need that line?????
|
||||
myServiceIntent = new Intent(context, AutomationService.class);
|
||||
myServiceIntent.putExtra("startAtBoot", startAtBoot);
|
||||
context.startService(myServiceIntent);
|
||||
} else
|
||||
}
|
||||
else
|
||||
Miscellaneous.logEvent("w", "Service", context.getResources().getString(R.string.logServiceAlreadyRunning), 3);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
Toast.makeText(context, context.getResources().getString(R.string.serviceWontStart), Toast.LENGTH_LONG).show();
|
||||
activityMainScreenInstance.toggleService.setChecked(false);
|
||||
|
Reference in New Issue
Block a user