title: Resume android activity from service
body: <p>i need to restart my main activity from background Service.<br>
  I get the results of my service by a BroadcastReceiver and I need to resume it (after some operations).</p>
  
  <p>Is it possible ?<br>
  How can i do this ?</p>
  
  <p>I tried this solution <a href="https://stackoverflow.com/questions/5502427/resume-application-and-stack-from-notification">Resume application and stack from notification</a> but it doesn't work for me.</p>
  
  <p>EDIT:<br>
  Thats my receiver:</p>
  
  <pre><code>private BroadcastReceiver receiver = new BroadcastReceiver() {
  
  
          @Override
          public void onReceive(Context context, Intent intent) {
            Bundle bundle = intent.getExtras();
            if (bundle != null) {
              int resultCode = bundle.getInt(DownloadService.RESULT);
              if (resultCode == RESULT_OK) {
                  Log.i("MyApp", "RESULT OK");
                  final Intent mainIntent = new Intent(context, MainActivity.class);
                  mainIntent.setAction(Intent.ACTION_MAIN);
                  mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
                  startActivity(mainIntent);
              } else {
                Toast.makeText(MainActivity.this, "KO",Toast.LENGTH_LONG).show();
              }
            }
          }
  
   };
  </code></pre>