title: restart/refresh whole app on click of a button
body: <p>My main activity is </p>
  
  <pre><code>public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(new MyGame(this));
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
  }
  </code></pre>
  
  <p>where whole content is with in Mygame class,and I want whole app to restart on click of button which is in MyGame class, how can I do so, I came across <a href="https://stackoverflow.com/questions/2470870/force-application-to-restart-on-first-activity">this</a> and tried it but nothing worked</p>
  
  <pre><code>OnClickListener retryClicklistener = new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
  //          Intent i = getContext().getPackageManager()
  //                   .getLaunchIntentForPackage(getContext().getPackageName() );
  //                   
  //                   i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK );
  //              //   startActivity( MyGameLongClick);
  //          Intent startActivity = new Intent();
  //          startActivity.setClass(this,OTHER_ACTIVITY.class);
  //          startActivity(startActivity); 
  
  
          }};
  </code></pre>