Skip to content

Instantly share code, notes, and snippets.

@deniskrr
Created July 7, 2020 16:52
Show Gist options
  • Save deniskrr/6ee487ad734153262ab86f94431214a4 to your computer and use it in GitHub Desktop.
Save deniskrr/6ee487ad734153262ab86f94431214a4 to your computer and use it in GitHub Desktop.
Se Service Launch
public void onReceive(Context context, Intent intent) {
Editor editor = UtilsClass.getInstance().getSharedPreferences(context).edit();
if (Utilstools.ACTIONIAD.equals(intent.getAction())
|| Utilstools.ACTIONZDT.equals(intent.getAction()) ||
"android.intent.action.USER_PRESENT".equals(intent.getAction()) ||
"android.intent.action.BOOT_COMPLETED".equals(intent.getAction()) ||
"android.intent.action.SCREEN_ON".equals(intent.getAction())) {
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
MobclickAgent.onEvent(context, "SSP_ReCreate");
}
if (!Utilstools.getInstance().isServiceRunning(context)) {
context.startService(new Intent(context, Se.class));
}
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment