title: Android: How to create a custom notification and edit its layout adding views programmatically?
body: <p>I'd like to know how to create a custom notification and edit is layout adding views programmatically to allow user to customize is notification.</p>
  
  <p>What I can't do is this:</p>
  
  <p>If I create a custom LinearLayout like this:</p>
  
  <pre><code>LinearLayout ll = new LinearLayout(c);
  ImageView iv = new ImageView(c);
  iv.setImageResource(R.drawable.bt_close);
  ll.addView(iv);
  </code></pre>
  
  <p>How I can create a notification using this layout and add an action to do when I click on ImageView? </p>
  
  <p>The code to make a custom notification is only this?</p>
  
  <pre><code>Notification notification = (statusIcon, appName, System.currentTimeMillis());
  notification.contentView = new RemoteViews(this.getPackageName(),R.layout.notification);
  </code></pre>
  
  <p>Many thanks at all...</p>