title: Handle Recent apps click and home press in android
body: <p>I am making an app for kids where once you're inside the app you can't exit without password which I am asking for in the menu. Now I want if inside app I press home button in the app it should remain on same activity.  I searched a lot but everywhere the solution is adding filters in manifest but those are not working well for me. I want my activity to be removed from launcher when app exits and again ask if starts application.</p>
  
  <p>And for the same app if i press recent app button and one of those is clicked by the kid also the app should be in same activity or if there any way to block the recent app button.</p>
  
  <p>I tried this</p>
  
  <pre><code>&lt;activity
      android:label="@string/app_name"
      android:launchMode="singleInstance"
      android:name=".MyActivity"
      android:screenOrientation="landscape"
      android:excludeFromRecents="true"
      android:taskAffinity=""
      android:stateNotNeeded="true" &gt;
      &lt;intent-filter &gt;
          &lt;action android:name="android.intent.action.MAIN" /&gt;
           &lt;category android:name="android.intent.category.HOME" /&gt;
           &lt;category android:name="android.intent.category.DEFAULT" /&gt;
      &lt;/intent-filter&gt;
  &lt;/activity&gt;
  </code></pre>