title: Push notification click not open my desire activity
body: <p>I have an issue while opening my desire activity when I click on notification. When application is active is work fine and open my desire activity.But when I put application in Pause state or minimize it always open my splash activity.</p>
  
  <p>This is my code for notification</p>
  
  <pre><code>private void createNotification(String title, String body) 
  {
      Context context = getBaseContext();
      if(sharedata.getDrivermode()) {
          if (sharedata.getDrivermode() == true) {
  
              notificationIntent = new Intent(this, MapFragmentDriver.class);
              notificationIntent.putExtra("dialog", "true");
          }
  
     if (sharedata.getDrivermode() == false) {
              if (pntype.equals("jr-driverDroped")) {
                  notificationIntent = new Intent(this, Ratingscreenpassenger.class);
              } else {
                  notificationIntent = new Intent(this, MapFragment.class);
              }
          }
      }
  
       notificationIntent.setAction(Intent.ACTION_MAIN);
      notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
              notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP|Intent.FLAG_ACTIVITY_CLEAR_TOP);
      NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
              .setSmallIcon(R.mipmap.ic_launcher)
              .setAutoCancel(true)
              .setPriority(2)
              .setTicker(title)
              .setContentText(body)
              .setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT))
              .setWhen(System.currentTimeMillis())
              .setContentTitle(title)
              .setDefaults(Notification.DEFAULT_ALL);
      NotificationManager mNotificationManager = (NotificationManager) context
              .getSystemService(Context.NOTIFICATION_SERVICE);
      mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, builder.build());
  }
  </code></pre>
  
  <p>This is my manifest file</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.live.wheelz"&gt;
  
      &lt;permission
          android:name="com.javapapers.currentlocationinmap.permission.MAPS_RECEIVE"
          android:protectionLevel="signature" /&gt;
      &lt;uses-permission android:name="android.permission.VIBRATE"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_SMS" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
      &lt;permission android:name="com.live.wheelz.permission.C2D_MESSAGE"
          android:protectionLevel="signature" /&gt;
      &lt;uses-permission android:name="com.live.wheelz.permission.C2D_MESSAGE" /&gt;
      &lt;uses-feature
          android:name="android.hardware.touchscreen.multitouch"
          android:required="false" /&gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
  
      &lt;application
          android:name="com.live.utilities.Config"
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;meta-data
              android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" /&gt;
  
          &lt;meta-data
              android:name="com.google.android.geo.API_KEY"
              android:value="@string/google_api_key" /&gt;
  
          &lt;activity
              android:name=".SplashActivity"
              android:screenOrientation="portrait"
  
              &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".MainActivity"
              android:screenOrientation="portrait"
              android:noHistory="true"
              &gt;&lt;/activity&gt;
          &lt;activity
              android:name=".VerifyToken"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
  
          &lt;activity
              android:name=".SetPassword"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".Profile"
              android:screenOrientation="portrait"
              &gt;&lt;/activity&gt;
          &lt;activity
              android:name=".Login"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".ForgetPassword"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".ResetPassword"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".ResetPasswordForget"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name="com.live.utilities.GalleryUtil"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".VheelzRide"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".CreditCardNo"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".MapFragment"
              android:screenOrientation="portrait"
              &gt;&lt;/activity&gt;
          &lt;activity
              android:name=".BaseActivity"
              android:screenOrientation="portrait"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".VheelzRideActive"
              android:screenOrientation="portrait"
              &gt;&lt;/activity&gt;
          &lt;activity
              android:name=".MapFragmentDriver"
              android:screenOrientation="portrait"
              android:exported="true"
              android:launchMode="singleTop"
              &gt;&lt;/activity&gt;
          &lt;activity
              android:name=".Ratingscreendriver"
              android:screenOrientation="portrait"
              android:exported="true"
              &gt;&lt;/activity&gt;
          &lt;activity
              android:name=".Ratingscreenpassenger"
              android:screenOrientation="portrait"
              android:exported="true"
              &gt;&lt;/activity&gt;
          &lt;activity
              android:name=".DialogActivityDriver"
              android:theme="@android:style/Theme.Holo.Light.Dialog"
              android:screenOrientation="portrait"
              &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".DialogActivityCancel"
              android:theme="@android:style/Theme.Holo.Light.Dialog"
              android:screenOrientation="portrait"
              &gt;
          &lt;/activity&gt;
  
          &lt;service
              android:name="com.live.utilities.GcmMessageHandler"
  
              android:exported="false" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
          &lt;receiver
              android:name="com.google.android.gms.gcm.GcmReceiver"
              android:exported="true"
              android:permission="com.google.android.c2dm.permission.SEND" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
                  &lt;!-- Receives the registration id. --&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
                  &lt;category android:name="com.live.wheelz" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  
          &lt;service
              android:name=".MyInstanceIDListenerService"
              android:exported="false"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.gms.iid.InstanceID"/&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
          &lt;service
              android:name="com.live.locationservices.LocationServiceDriver"
              android:exported="false" /&gt;
          &lt;service
              android:name="com.live.locationservices.LocationService"
              android:exported="false" /&gt;
          &lt;service android:name=".RegistrationIntentService" android:exported="false"/&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>