ContextUtil.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package com.edufound.mobile.util;
  2. import android.app.Application;
  3. import android.content.Context;
  4. import com.edufound.mobile.base.BaseView;
  5. public class ContextUtil {
  6. public static final String CLOSE_ACTIVITY_SPLASH = "com.edufound.mobile.close.splash";
  7. public static final String CLOSE_ACTIVITY_MAIN = "com.edufound.mobile.close.main";
  8. public static final String CLOSE_ACTIVITY_PAY = "com.edufound.mobile.close.pay";
  9. public static final String RESTART_ACTIVITY_MAIN = "com.edufound.mobile.restart.main";
  10. public static final String CHANGE_VIDEO_TYPE_VIDEO = "com.edufound.mobile.change.video";
  11. public static final String CHANGE_VIDEO_TYPE_IJKPLAYER = "com.edufound.mobile.change.ijkplayer";
  12. public static final String NOTIFICATION_WEB_PLAYERTIME = "com.edufound.mobile.notification.playertime";
  13. static Context mContext;
  14. static Application application;
  15. public static Application getApplication() {
  16. return application;
  17. }
  18. public static void setApplication(Application application) {
  19. ContextUtil.application = application;
  20. }
  21. static boolean isDebug;
  22. static boolean mNetWorkState = true;
  23. public static boolean getNetWorkState() {
  24. return mNetWorkState;
  25. }
  26. public static void setmNetWorkState(boolean mNetWorkState) {
  27. ContextUtil.mNetWorkState = mNetWorkState;
  28. }
  29. public static void setContext(Context context) {
  30. mContext = context;
  31. }
  32. public static Context getContext() {
  33. if (mContext == null) {
  34. return null;
  35. }
  36. return mContext;
  37. }
  38. public static boolean isIsDebug() {
  39. return isDebug;
  40. }
  41. public static void setIsDebug(boolean isDebug) {
  42. ContextUtil.isDebug = isDebug;
  43. }
  44. }