ContextUtil.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package com.edufound.android.xyyf.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. public static final String URL_POST_USER_TIME = "http://m-xyyf-api.ai160.com/onlineTime";
  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. private static String TMAIL_USER_ID = "-1";
  24. private static String TMAIL_DEVICE_ID = "-1";
  25. public static boolean getNetWorkState() {
  26. return mNetWorkState;
  27. }
  28. public static void setmNetWorkState(boolean mNetWorkState) {
  29. ContextUtil.mNetWorkState = mNetWorkState;
  30. }
  31. public static void setContext(Context context) {
  32. mContext = context;
  33. }
  34. public static Context getContext() {
  35. if (mContext == null) {
  36. return null;
  37. }
  38. return mContext;
  39. }
  40. public static boolean isIsDebug() {
  41. return isDebug;
  42. }
  43. public static void setIsDebug(boolean isDebug) {
  44. ContextUtil.isDebug = isDebug;
  45. }
  46. public static String getTmailUserId() {
  47. return TMAIL_USER_ID;
  48. }
  49. public static void setTmailUserId(String tmailUserId) {
  50. TMAIL_USER_ID = tmailUserId;
  51. }
  52. public static String getTmailDeviceId() {
  53. return TMAIL_DEVICE_ID;
  54. }
  55. public static void setTmailDeviceId(String tmailDeviceId) {
  56. TMAIL_DEVICE_ID = tmailDeviceId;
  57. }
  58. }