package org.gdg.frisbee.android.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.google.android.gms.analytics.HitBuilders;
import com.google.android.gms.plus.PlusShare;

import org.gdg.frisbee.android.Const;
import org.gdg.frisbee.android.app.App;
import org.gdg.frisbee.android.chapter.MainActivity;
import org.gdg.frisbee.android.event.EventActivity;

import timber.log.Timber;

public class ParseDeepLinkActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent target = null;

        String deepLinkId = PlusShare.getDeepLinkId(getIntent());
        if (!TextUtils.isEmpty(deepLinkId)) {
            target = parseDeepLinkId(deepLinkId);
        } else {
            if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
                target = new Intent();
                target.setClass(getApplicationContext(), EventActivity.class);
                target.putExtra(Const.EXTRA_EVENT_ID, getIntent().getData().getLastPathSegment());
                target.putExtra(Const.EXTRA_SECTION, EventActivity.EventPagerAdapter.SECTION_OVERVIEW);
            }
        }

        if (target != null) {
            if (target.resolveActivity(getPackageManager()) != null) {
                startActivity(target);
            }
        }

        finish();
    }

    /**
     * Get the intent for an activity corresponding to the deep-link ID.
     *
     * @param deepLinkId The deep-link ID to parse.
     * @return The intent corresponding to the deep-link ID.
     */
    @Nullable
    private Intent parseDeepLinkId(@NonNull String deepLinkId) {
        Intent route = new Intent();
        Timber.d("Deep Link id: %s", deepLinkId);
        String[] parts = deepLinkId.split("/");

        App.getInstance().getTracker().send(new HitBuilders.EventBuilder()
            .setCategory("gplus")
            .setAction("deepLink")
            .setLabel(deepLinkId)
            .build());

        // Our deep links look like this: https://developers.google.com/events/<eventId>/join,
        // or <plus_id>/events/<eventId>/join    join is optional
        if (deepLinkId.startsWith(Const.URL_DEVELOPERS_GOOGLE_COM)) {
            route.setClass(getApplicationContext(), EventActivity.class);
            route.putExtra(Const.EXTRA_EVENT_ID, parts[4]);
            route.putExtra(Const.EXTRA_SECTION, EventActivity.EventPagerAdapter.SECTION_OVERVIEW);
        } else {
            // Fallback to the MainActivity in your app.
            route.setClass(getApplicationContext(), MainActivity.class);
        }
        return route;
    }
}

@@ -169,52 +169,8 @@
 ll;%0A
-import android.support.annotation.Nullable;%0A
 impo
@@ -1334,28 +1334,12 @@
 null
-) %7B%0A            if (
+ && 
 targ
@@ -1401,20 +1401,16 @@
         
-    
 startAct
@@ -1424,30 +1424,16 @@
 arget);%0A
-            %7D%0A
         
@@ -1673,22 +1673,8 @@
  */%0A
-    @Nullable%0A
     

Remove unnecessary @Nulable annotation. Merge if's.