Parcourir la Source

Merge branch 'master' of http://git.quyaqu.com/xieshengqi/MoneyMoreMoreNote

Xieshengqi il y a 7 ans
Parent
commit
b538899998

+ 8 - 0
app/src/main/java/com/kuxuan/moneynote/receiver/AlarmReceiver.java

@@ -2,16 +2,19 @@ package com.kuxuan.moneynote.receiver;
2 2
 
3 3
 import android.app.Notification;
4 4
 import android.app.NotificationManager;
5
+import android.app.PendingIntent;
5 6
 import android.content.BroadcastReceiver;
6 7
 import android.content.Context;
7 8
 import android.content.Intent;
8 9
 import android.graphics.Bitmap;
9 10
 import android.graphics.BitmapFactory;
11
+import android.os.SystemClock;
10 12
 import android.support.v7.app.NotificationCompat;
11 13
 import android.util.Log;
12 14
 import android.widget.RemoteViews;
13 15
 
14 16
 import com.kuxuan.moneynote.R;
17
+import com.kuxuan.moneynote.ui.activitys.MainActivity;
15 18
 
16 19
 import static com.umeng.socialize.utils.ContextUtil.getPackageName;
17 20
 
@@ -36,6 +39,11 @@ public  class AlarmReceiver extends BroadcastReceiver {
36 39
             builder.setPriority(Notification.PRIORITY_DEFAULT);
37 40
             NotificationManager notificationManager = (NotificationManager) context
38 41
                     .getSystemService(Context.NOTIFICATION_SERVICE);
42
+        Intent intent1 = new Intent(context, MainActivity.class);
43
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
44
+        int requestCode = (int) SystemClock.uptimeMillis();
45
+        PendingIntent pendingIntent = PendingIntent.getActivity(context, requestCode, intent1, PendingIntent.FLAG_UPDATE_CURRENT);
46
+        contentView.setOnClickPendingIntent(R.id.notification, pendingIntent);
39 47
             notificationManager.notify(111, builder.build());
40 48
 
41 49
 

+ 4 - 4
app/src/main/java/com/kuxuan/moneynote/ui/fragments/mine/MineFragment.java

@@ -323,7 +323,7 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
323 323
         public void onResult(SHARE_MEDIA platform) {
324 324
 
325 325
             if (platform.name().equals("WEIXIN_FAVORITE")) {
326
-                Toast.makeText(mActivity.get(), platform + " 收藏成功啦", Toast.LENGTH_SHORT).show();
326
+                Toast.makeText(mActivity.get()," 收藏成功啦", Toast.LENGTH_SHORT).show();
327 327
             } else {
328 328
                 if (platform != SHARE_MEDIA.MORE && platform != SHARE_MEDIA.SMS
329 329
                         && platform != SHARE_MEDIA.EMAIL
@@ -337,7 +337,7 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
337 337
                         && platform != SHARE_MEDIA.GOOGLEPLUS
338 338
                         && platform != SHARE_MEDIA.YNOTE
339 339
                         && platform != SHARE_MEDIA.EVERNOTE) {
340
-                    Toast.makeText(mActivity.get(), platform + " 分享成功啦", Toast.LENGTH_SHORT).show();
340
+                    Toast.makeText(mActivity.get(),  " 分享成功啦", Toast.LENGTH_SHORT).show();
341 341
                 }
342 342
 
343 343
             }
@@ -357,7 +357,7 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
357 357
                     && platform != SHARE_MEDIA.GOOGLEPLUS
358 358
                     && platform != SHARE_MEDIA.YNOTE
359 359
                     && platform != SHARE_MEDIA.EVERNOTE) {
360
-                Toast.makeText(mActivity.get(), platform + " 分享失败啦", Toast.LENGTH_SHORT).show();
360
+                Toast.makeText(mActivity.get(),  " 分享失败啦", Toast.LENGTH_SHORT).show();
361 361
                 if (t != null) {
362 362
                     Log.d("throw", "throw:" + t.getMessage());
363 363
                 }
@@ -368,7 +368,7 @@ public class MineFragment extends MVPFragment<MinePresent, MineModel> implements
368 368
         @Override
369 369
         public void onCancel(SHARE_MEDIA platform) {
370 370
 
371
-            Toast.makeText(mActivity.get(), platform + " 分享取消了", Toast.LENGTH_SHORT).show();
371
+            Toast.makeText(mActivity.get(),  " 分享取消了", Toast.LENGTH_SHORT).show();
372 372
         }
373 373
     }
374 374
 

+ 1 - 0
app/src/main/res/layout/notification.xml

@@ -2,6 +2,7 @@
2 2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     android:orientation="horizontal"
4 4
     android:gravity="center"
5
+    android:id="@+id/notification"
5 6
     android:layout_width="match_parent"
6 7
     android:layout_height="match_parent">
7 8
 <ImageView