mirror of
https://github.com/gsantner/dandelion
synced 2025-09-11 03:09:48 +02:00
Update opoc and it's license headers
This commit is contained in:
parent
1129f1848a
commit
2289c04f0f
11 changed files with 381 additions and 56 deletions
|
@ -3,17 +3,20 @@
|
|||
* Maintained by Gregor Santner, 2016-
|
||||
* https://gsantner.net/
|
||||
*
|
||||
* License: Apache 2.0 / Commercial
|
||||
* https://github.com/gsantner/opoc/#licensing
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* License of this file: Apache 2.0 (Commercial upon request)
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://github.com/gsantner/opoc/#licensing
|
||||
*
|
||||
#########################################################*/
|
||||
package net.gsantner.opoc.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.StringRes;
|
||||
|
@ -174,4 +177,12 @@ public class ActivityUtils extends net.gsantner.opoc.util.ContextUtils {
|
|||
_activity.getWindow().setStatusBarColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
public void setLauncherActivityEnabled(Class activityClass, boolean enable) {
|
||||
Context context = _context.getApplicationContext();
|
||||
PackageManager pkg = context.getPackageManager();
|
||||
ComponentName component = new ComponentName(context, activityClass);
|
||||
pkg.setComponentEnabledSetting(component, enable ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
, PackageManager.DONT_KILL_APP);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue