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 | 24 | </value> |
| 25 | 25 | </option> |
| 26 | 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 | 28 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 29 | 29 | </component> |
| 30 | 30 | <component name="ProjectType"> | ... | ... |
app/src/main/java/com/shunzhi/parent/AppContext.java
| ... | ... | @@ -19,6 +19,7 @@ import com.share.mvpsdk.helper.RetrofitCreateHelper; |
| 19 | 19 | import com.shunzhi.parent.bean.message.DaoMaster; |
| 20 | 20 | import com.shunzhi.parent.bean.message.DaoMaster.DevOpenHelper; |
| 21 | 21 | import com.shunzhi.parent.bean.message.DaoSession; |
| 22 | +import com.shunzhi.parent.manager.MessageManager; | |
| 22 | 23 | import com.shunzhi.parent.ui.MainActivity; |
| 23 | 24 | |
| 24 | 25 | import org.greenrobot.greendao.database.Database; |
| ... | ... | @@ -50,6 +51,7 @@ public class AppContext extends GlobalApplication { |
| 50 | 51 | //声明AMapLocationClientOption对象 |
| 51 | 52 | public AMapLocationClientOption mLocationOption = null; |
| 52 | 53 | |
| 54 | + private MessageManager messageManager; | |
| 53 | 55 | @Override |
| 54 | 56 | public void onCreate() { |
| 55 | 57 | appContext = this; |
| ... | ... | @@ -59,6 +61,11 @@ public class AppContext extends GlobalApplication { |
| 59 | 61 | NIMClient.init(this, loginInfo(), options()); |
| 60 | 62 | initDB(); |
| 61 | 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 | 71 | private void initDB() { | ... | ... |
app/src/main/java/com/shunzhi/parent/manager/MessageManager.java
| ... | ... | @@ -104,6 +104,7 @@ public class MessageManager { |
| 104 | 104 | session.setSessionName("作业通知"); |
| 105 | 105 | session.setDate(new Date(customNotification.getTime())); |
| 106 | 106 | session.setSessionText(json.optString("title")); |
| 107 | + | |
| 107 | 108 | PHMessage message = new PHMessage(); |
| 108 | 109 | PHMessageDao messageDao = AppContext.getInstance().getDaoSession().getPHMessageDao(); |
| 109 | 110 | message.setDate(new Date(customNotification.getTime())); | ... | ... |