VoiceRecognition.java - No Internet connection or Airplane mode
<p>I'm looking to allow my <code>VoiceRecognition.java</code> code to start another activity if it sees that the Phone does not have a signal/internet connection/etc.  Here is the code (adopted from Google).</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Inflate our UI from its XML layout description.
    setContentView(R.layout.voice_recognition);

    // Get display items for later interaction
    Button speakButton = (Button) findViewById(R.id.btn_speak);

    View exitButton = findViewById(R.id.exit_button);
    exitButton.setOnClickListener(this);

    mList = (ListView) findViewById(R.id.list);

    // Check to see if a recognition activity is present
    PackageManager pm = getPackageManager();
    List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities(
            new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
    if (activities.size() != 0) {


        speakButton.setOnClickListener(this);
    } 

    else {
        speakButton.setEnabled(false);

        Intent b = new Intent(this, ReminderEditActivity.class);
         startActivity(b);;
    }
}
</code></pre>

<p>I tried to add the intent with the <code>ReminderEditActivity.class</code>.  Furthermore, I tried to flip the If statement around to say that if (<code>activitysize = 0</code>) then go to the <code>ReminderEditActivity.class</code>.  I got an error there.</p>
