INNER CODE UNIT · Java

onCreate

DroidPluginTeam/DroidPlugin · project/Libraries/DroidPlugin/src/main/java/com/morgoo/droidplugin/PluginManagerService.java:58

    public void onCreate() {
        super.onCreate();
        keepAlive();
        getPluginPackageManager(this);
    }

    private void keepAlive() {
        try {
            Notification notification = new Notification();
            notification.flags |= Notification.FLAG_NO_CLEAR;
            notification.flags |= Notification.FLAG_ONGOING_EVENT;
            startForeground(0, notification); // 设置为前台服务避免kill,Android4.3及以上需要设置id为0时通知栏才不显示该通知;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    @Override

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…