Commit 7138f16583d887a20074d6bcfa4552d8a2a2f425
Exists in
yxb_dev
and in
2 other branches
no message
Showing
3 changed files
with
9 additions
and
1 deletions
Show diff stats
.idea/misc.xml
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | </value> | 24 | </value> |
25 | </option> | 25 | </option> |
26 | </component> | 26 | </component> |
27 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | 27 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> |
28 | <output url="file://$PROJECT_DIR$/build/classes" /> | 28 | <output url="file://$PROJECT_DIR$/build/classes" /> |
29 | </component> | 29 | </component> |
30 | <component name="ProjectType"> | 30 | <component name="ProjectType"> |
app/src/main/java/com/shunzhi/parent/AppContext.java
@@ -19,6 +19,7 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; | @@ -19,6 +19,7 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; | ||
19 | import com.shunzhi.parent.bean.message.DaoMaster; | 19 | import com.shunzhi.parent.bean.message.DaoMaster; |
20 | import com.shunzhi.parent.bean.message.DaoMaster.DevOpenHelper; | 20 | import com.shunzhi.parent.bean.message.DaoMaster.DevOpenHelper; |
21 | import com.shunzhi.parent.bean.message.DaoSession; | 21 | import com.shunzhi.parent.bean.message.DaoSession; |
22 | +import com.shunzhi.parent.manager.MessageManager; | ||
22 | import com.shunzhi.parent.ui.MainActivity; | 23 | import com.shunzhi.parent.ui.MainActivity; |
23 | 24 | ||
24 | import org.greenrobot.greendao.database.Database; | 25 | import org.greenrobot.greendao.database.Database; |
@@ -50,6 +51,7 @@ public class AppContext extends GlobalApplication { | @@ -50,6 +51,7 @@ public class AppContext extends GlobalApplication { | ||
50 | //声明AMapLocationClientOption对象 | 51 | //声明AMapLocationClientOption对象 |
51 | public AMapLocationClientOption mLocationOption = null; | 52 | public AMapLocationClientOption mLocationOption = null; |
52 | 53 | ||
54 | + private MessageManager messageManager; | ||
53 | @Override | 55 | @Override |
54 | public void onCreate() { | 56 | public void onCreate() { |
55 | appContext = this; | 57 | appContext = this; |
@@ -59,6 +61,11 @@ public class AppContext extends GlobalApplication { | @@ -59,6 +61,11 @@ public class AppContext extends GlobalApplication { | ||
59 | NIMClient.init(this, loginInfo(), options()); | 61 | NIMClient.init(this, loginInfo(), options()); |
60 | initDB(); | 62 | initDB(); |
61 | RetrofitCreateHelper.getInstance().setAuthorization(AppConfig.getAppConfig(this).get(AppConfig.ACCESS_TOKEN)); | 63 | RetrofitCreateHelper.getInstance().setAuthorization(AppConfig.getAppConfig(this).get(AppConfig.ACCESS_TOKEN)); |
64 | + messageManager = MessageManager.getInstance(); | ||
65 | + } | ||
66 | + | ||
67 | + public MessageManager getMessageManager(){ | ||
68 | + return messageManager; | ||
62 | } | 69 | } |
63 | 70 | ||
64 | private void initDB() { | 71 | private void initDB() { |
app/src/main/java/com/shunzhi/parent/manager/MessageManager.java
@@ -104,6 +104,7 @@ public class MessageManager { | @@ -104,6 +104,7 @@ public class MessageManager { | ||
104 | session.setSessionName("作业通知"); | 104 | session.setSessionName("作业通知"); |
105 | session.setDate(new Date(customNotification.getTime())); | 105 | session.setDate(new Date(customNotification.getTime())); |
106 | session.setSessionText(json.optString("title")); | 106 | session.setSessionText(json.optString("title")); |
107 | + | ||
107 | PHMessage message = new PHMessage(); | 108 | PHMessage message = new PHMessage(); |
108 | PHMessageDao messageDao = AppContext.getInstance().getDaoSession().getPHMessageDao(); | 109 | PHMessageDao messageDao = AppContext.getInstance().getDaoSession().getPHMessageDao(); |
109 | message.setDate(new Date(customNotification.getTime())); | 110 | message.setDate(new Date(customNotification.getTime())); |