title: Is setContentIntent(PendingIntent) required in NotificationCompat.Builder?
body: <p>Calling :</p>
  
  <pre><code>public static void triggerTestNotification(Context ctx, String tag, int id) {
      Notification not = new NotificationCompat.Builder(ctx)
          .setContentTitle("Title").setContentText("Text")
          .setAutoCancel(true) // cancel on click
          .setSmallIcon(R.drawable.ic_launcher).build();
      NotificationManager notificationManager = (NotificationManager) ctx
          .getSystemService(Context.NOTIFICATION_SERVICE);
      notificationManager.notify(tag, id, not);
  }
  </code></pre>
  
  <p>in <code>onCreate()</code> of my main activity yields :</p>
  
  <pre><code>11-17 15:58:46.198: E/AndroidRuntime(1507): FATAL EXCEPTION: main
  11-17 15:58:46.198: E/AndroidRuntime(1507): java.lang.RuntimeException: Unable to start activity ComponentInfo{gr.uoa.di.monitoring.android/gr.uoa.di.monitoring.android.activities.MainActivity}: java.lang.IllegalArgumentException: contentIntent required: pkg=gr.uoa.di.monitoring.android id=0 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x10)
  //...
  11-17 15:58:46.198: E/AndroidRuntime(1507): Caused by: java.lang.IllegalArgumentException: contentIntent required: pkg=gr.uoa.di.monitoring.android id=0 notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x10)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at android.os.Parcel.readException(Parcel.java:1326)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at android.os.Parcel.readException(Parcel.java:1276)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:274)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at android.app.NotificationManager.notify(NotificationManager.java:133)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at gr.uoa.di.monitoring.android.C.triggerTestNotification(C.java:200)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at gr.uoa.di.monitoring.android.activities.MainActivity.onCreate(MainActivity.java:44)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
  11-17 15:58:46.198: E/AndroidRuntime(1507):     ... 11 more
  </code></pre>
  
  <p>Notice the <em><a href="http://developer.android.com/reference/android/app/Notification.html#contentIntent" rel="nofollow noreferrer">contentIntent</a> required</em>.</p>
  
  <p>However the docs <a href="http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CreateNotification" rel="nofollow noreferrer">could not be more clear</a> :</p>
  
  <blockquote>
    <p><strong>Required notification contents</strong></p>
    
    <p>A Notification object must contain the following:</p>
    
    <ul>
    <li><p>A small icon, set by setSmallIcon()</p></li>
    <li><p>A title, set by setContentTitle()</p></li>
    <li><p>Detail text, set by setContentText()</p></li>
    </ul>
    
    <p><strong>Optional notification contents and settings</strong></p>
    
    <p>All other notification settings and contents are optional. To learn more about them, see the reference documentation for NotificationCompat.Builder. </p>
  </blockquote>
  
  <p>This opinion is reflected in <a href="https://stackoverflow.com/a/13902307/281545">various</a> SO <a href="https://stackoverflow.com/a/16392090/281545">answers</a> and results in SO <a href="https://stackoverflow.com/questions/12008226/notificationcompat2-error-java-lang-illegalargumentexception">questions</a> (and <a href="https://stackoverflow.com/questions/14682335/notificationcompat-builder-doesnt-work-android-2-2-1">another</a> one).</p>
  
  <p>workaround :</p>
  
  <pre><code>final Intent emptyIntent = new Intent();
  PendingIntent pi = PendingIntent.getActivity(ctx, NOT_USED,
      emptyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
  //...
  .setContentIntent(pi).build;
  </code></pre>
  
  <p>But is this really needed ? Is all this situation another <em>Android docs bug</em> ? Is it API dependent ?</p>
  
  <p>NB my target SDK is 17 and running this on a 2.3.7 phone</p>