package com.marvinlabs.intents.demo;

import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;



public class MainActivity extends ActionBarActivity implements IntentItemFragment.OnFragmentInteractionListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new IntentItemFragment())
                    .commit();
        }
    }

    @Override
    public void onFragmentInteraction(Intent intent) {
        if(intent.resolveActivity(getPackageManager()) != null) {
            startActivity(intent);
        }
    }
}

@@ -970,98 +970,201 @@
     
-if(intent.resolveActivity(getPackageManager()) != null) %7B%0A            startActivity(intent
+try%7B%0A            startActivity(intent);%0A        %7Dcatch(ClassNotFoundException e)%0A        %7B%0A            Toast.makeText(getApplicationContext(), %22Error, try again later%22, Toast.LENGTH_LONG).show(
 );%0A 

Update MainActivity.java