Back to project page wonderpush-android-sdk.
The source code is released under:
Apache License
If you think the Android project wonderpush-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.wonderpush.sdk; /*ww w. j a v a2s.co m*/ import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Application; import android.app.Application.ActivityLifecycleCallbacks; import android.graphics.drawable.Drawable; import android.os.Build; import android.view.Gravity; import android.view.View; import android.webkit.WebView; class WonderPushCompatibilityHelper { @SuppressLint("NewApi") @SuppressWarnings("deprecation") public static void ViewSetBackground(View view, Drawable background) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setBackground(background); } else { view.setBackgroundDrawable(background); } } @SuppressWarnings("deprecation") public static void WebViewSettingsSetDatabasePath(WebView webView, String path) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { webView.getSettings().setDatabasePath(path); } } @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @SuppressLint("RtlHardcoded") public static int getGravityEnd() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { return Gravity.END; } return Gravity.RIGHT; } @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) public static void ApplicationRegisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacks callbacks) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { application.registerActivityLifecycleCallbacks(callbacks); } } }