OSDN Git Service

apparently some phones crash if a notification is made without a contentIntent
authorKoushik Dutta <koushd@gmail.com>
Wed, 6 Mar 2013 23:40:58 +0000 (15:40 -0800)
committerKoushik Dutta <koushd@gmail.com>
Wed, 6 Mar 2013 23:40:58 +0000 (15:40 -0800)
Change-Id: I962a787189910866dea0519acbc4dfe7ea5e5fb1

Superuser/AndroidManifest.xml
Superuser/src/com/koushikdutta/superuser/SuReceiver.java

index 391e820..cb10202 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.koushikdutta.superuser"
-    android:versionCode="1012"
-    android:versionName="1.0.1.2" >
+    android:versionCode="1013"
+    android:versionName="1.0.1.3" >
 
     <uses-sdk
         android:minSdkVersion="8"
index 6733c58..558b901 100644 (file)
@@ -17,6 +17,7 @@
 package com.koushikdutta.superuser;
 
 import android.app.NotificationManager;
+import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -77,6 +78,8 @@ public class SuReceiver extends BroadcastReceiver {
         case Settings.NOTIFICATION_TYPE_NOTIFICATION:
             NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
             builder.setTicker(toast)
+            .setAutoCancel(true)
+            .setContentIntent(PendingIntent.getActivity(context, 0, new Intent(), 0))
             .setContentTitle(context.getString(R.string.superuser))
             .setContentText(toast)
             .setSmallIcon(R.drawable.ic_stat_notification);