ContextUtil.java 1.7 KB

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