title: Option Menu Button Code getting Stuck and Hanging
body: <p>I'm struggling to see why my code is not getting into the try statement after I hit the NearBy button on the options menu.  It goes to a black screen but the IN NEAR CASE string doesn't display in the output of the logcat in Eclipse or in aLogCat on an Android phone?  What am I doing wrong? </p>
  
  <pre><code>import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.os.Bundle;
  import android.util.Base64;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.ImageButton;
  import android.widget.ListView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class ProfileActivity extends Activity {
  
  private static final int NEAR = Menu.FIRST;
  
  public boolean onCreateOptionsMenu(Menu menu) {
      menu.add(0, NEAR, 0, "NearBy").setIcon(android.R.drawable.ic_menu_info_details);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
  
     switch (item.getItemId()) {
     case NEAR:
         try {
             Log.e(LOG_TAG,"IN NEAR CASE");
                 Intent myIntent = new Intent(ProfileActivity.this,
                        AndroidClient.class);
          } catch (NumberFormatException nfe) {
              nfe.printStackTrace();
              Toast.makeText(this, "Value Age is not correct", Toast.LENGTH_LONG).show();
          } catch (NullPointerException npe) {
              npe.printStackTrace();
              Toast.makeText(this, "Error", Toast.LENGTH_LONG).show();
          }
  
          break;
      }
  
      return true;
  }
  }
  </code></pre>