title: Android app closes on when onBackPressed callled
body: <p>I have a share button on my app. When the share button is clicked a share dialog opens with a list of sharing options. The probelm is when i decide i dont want to share(when the dialog is open) and press the back button on the phone, the app closes...how can i fix this??? i cant see the problem</p>
  
  <pre><code>share.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View arg0) {
              dbControl = new DatabaseControl(ScoreMenu.this);
              dbControl.open();
              score = dbControl.fetchBestTime();
              dbControl.close();
              share(score);
          }
      });
  }
  
  public void share(String score){
      Intent shareIntent = new Intent(Intent.ACTION_SEND);
      shareIntent.setType("text/plain");
      shareIntent.putExtra(Intent.EXTRA_SUBJECT, "");
      shareIntent.putExtra(Intent.EXTRA_TEXT, "");
      startActivity(Intent.createChooser(shareIntent, ""));
  }
  
  @Override
  public void onBackPressed() {
      Intent goToMainScreen = new Intent(ScoreMenu.this, MainActivity.class);
      if (android.os.Build.VERSION.SDK_INT &gt;= 16) {
          // Start activity with a custom animation
          Bundle bundle_animation = ActivityOptions.makeCustomAnimation(ScoreMenu.this,      R.anim.slide_in_right, R.anim.slide_out_left).toBundle();
          startActivity(goToMainScreen, bundle_animation);
      }
      else {                     
          startActivity(goToMainScreen);
      }
  }
  </code></pre>
  
  <p>Hope you can help...</p>