title: Starting calculator, returning to activity that launched calc
body: <p>I'm launching the device's standard calculator from an activity, but if I close the calculator, it doesn't return to the activity that launched the calculator. Do I have to set a certain FLAG?</p>
  
  <p>Code:</p>
  
  <pre><code>public void LaunchDeviceCalculator(){
          ArrayList&lt;HashMap&lt;String,Object&gt;&gt; packages =new ArrayList&lt;HashMap&lt;String,Object&gt;&gt;();
          final PackageManager pm = getPackageManager();
          List&lt;PackageInfo&gt; packs = pm.getInstalledPackages(0);  
          for (PackageInfo pi : packs) {
          if( pi.packageName.toString().toLowerCase().contains("calcul")){
              HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
              map.put("appName", pi.applicationInfo.loadLabel(pm));
              map.put("packageName", pi.packageName);
              packages.add(map);
      }
          }
  
          if(packages.size()&gt;=1){
              String packageName = (String) packages.get(0).get("packageName");
              Intent i = pm.getLaunchIntentForPackage(packageName);
  
              if (i != null)
                startActivity(i);
              } 
  }
  </code></pre>