title: Android: Don't open app after performing notification on-click action
body: <p>The main part of my app is a service that displays a notification. The GUI of the app is only  used to be able to change some settings. When I click on that notification, some data should be send in the background without opening the app. To do that, I created an invisible activity.</p>
  
  <p>When I open the app (the configuration part) and exit it with the back button, everything works as intended; when clicking on the notification the data is send without opening the app.</p>
  
  <p>When I exit the app with the home button, every time I click the notification the app opens again.</p>
  
  <p>This is my notification and the Intent to call the data activity:</p>
  
  <pre><code>PendingIntent toggleLightsIntent = 
      PendingIntent.getActivity(
      this,
      0,
      new Intent(this, HyperionToggleSwitchActivity.class),
      PendingIntent.FLAG_NO_CREATE);
  
  Notification notification = new Notification.Builder(this)
      .setSmallIcon(R.drawable.ic_launcher)
      .setContentTitle("HyperionSwitch")
      .setContentText("Switch lights")
      .setContentIntent(toggleLightsIntent)
      .build();
  </code></pre>
  
  <p>And this is the part where I send the data:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      sendJson(blue);
      finish();
  }
  </code></pre>
  
  <p>What do I have to change so the app won't open when clicking the notification?
  It's my first app and took me quite a while to get what I have so far...</p>