List of utility methods to do Context Set
void | setLanguage(Context context, String language) set Language Locale locale; if (TextUtils.isEmpty(language)) { locale = Locale.getDefault(); } else if (language.length() == 5 && language.charAt(2) == '_') { locale = new Locale(language.substring(0, 2), language.substring(3)); } else { locale = new Locale(language); ... |
void | setProxy(Context ctx) set Proxy setProxy(ctx, DEFAULT_HOST, DEFAULT_PORT); |
boolean | setProxy(Context ctx, String host, int port) set Proxy setSystemProperties(host, port); boolean worked = false; if (Build.VERSION.SDK_INT < 14) { worked = setWebkitProxyGingerbread(ctx, host, port); } else { worked = setWebkitProxyICS(ctx, host, port); return worked; ... |
void | setRevokedPermissions(String packageName, String[] permissions, Context ctx) set Revoked Permissions PackageManager pkgManager = ctx.getPackageManager(); Method setRevokedPermissions; try { setRevokedPermissions = pkgManager.getClass().getMethod( "setRevokedPermissions", java.lang.String.class, String[].class); Object[] params = new Object[] { packageName, permissions }; setRevokedPermissions.invoke(pkgManager, params); ... |
boolean | setWebkitProxyGingerbread(Context ctx, String host, int port) Override WebKit Proxy settings boolean ret = false; Object requestQueueObject = getRequestQueue(ctx); if (requestQueueObject != null) { HttpHost httpHost = new HttpHost(host, port, "http"); setDeclaredField(requestQueueObject, "mProxyHost", httpHost); return true; return false; ... |
boolean | setWebkitProxyICS(Context ctx, String host, int port) set Webkit Proxy ICS try { Class webViewCoreClass = Class .forName("android.webkit.WebViewCore"); Class proxyPropertiesClass = Class .forName("android.net.ProxyProperties"); if (webViewCoreClass != null && proxyPropertiesClass != null) { Method m = webViewCoreClass.getDeclaredMethod( "sendStaticMessage", Integer.TYPE, Object.class); ... |
void | setWelcomeShown(final Context ctx) set Welcome Shown ctx.getSharedPreferences("_welcome_dialog_shown", Context.MODE_PRIVATE).edit().putBoolean("shown", true) .commit(); |