title: android : get an singleTask activity from background to foreground
body: <p>I am developing an app using phonegap and mobile jquery.</p>
  
  <p>There's a point in my app where it is running in the background and if an event triggered from js, I want to make my app to come in foreground.</p>
  
  <p>How can I make my app come to foreground from background. I have a single activity with following attribute:</p>
  
  <pre><code>android:configChanges="orientation|keyboardHidden|screenLayout"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="adjustPan" 
          android:launchMode="singleTask"        
          android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar"
  </code></pre>
  
  <p>what i tried to make my app in foreground is : </p>
  
  <pre><code>    Intent intent = new Intent(mContext , MainActivity.class);
      intent.setAction(Intent.ACTION_MAIN);
      intent.addCategory(Intent.CATEGORY_LAUNCHER);
      mContext.startActivity(intent);
  </code></pre>
  
  <p>And</p>
  
  <pre><code>mContext.startActivity(((Activity)mContext).getIntent());
  </code></pre>
  
  <p>(MainActivity is the only activity in my app ) but it is not working. I am using android 4.0.</p>
  
  <p>Update : In android 2.3 its working fine but its not working in android 4.0</p>