ContextUtil.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // public static final String URL_POST_USER_TIME = "http://m-xyyf-api.efunbox.cn/onlineTime";//测试环境
  14. public static final String GET_USER_PHONENUMBER_URL = "http://m-xyyf-api.ai160.com/member/getMobile";
  15. static Context mContext;
  16. static Application application;
  17. public static Application getApplication() {
  18. return application;
  19. }
  20. public static void setApplication(Application application) {
  21. ContextUtil.application = application;
  22. }
  23. static boolean isDebug;
  24. static boolean mNetWorkState = true;
  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 getGetUserPhonenumberUrl() {
  47. return GET_USER_PHONENUMBER_URL;
  48. }
  49. }