Disable home button for a specific activity in an app

  • Replies:0
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Feb 12, 2018, 7:27:17 AM via Website

Is it possible to disable home button in a specific activity? I just needed to disable home button in one activity but when my app redirected to other it should re enable the home button.
MainActivity contains a webview, here I need to disable home key, then on a condition I redirected the app to another activity, here I need to re-enable home key otherwise it is not possible to exit from my app as I disabled all other key.

(I have tried <category android:name="android.intent.category.DEFAULT" /> for my activity(MainActivity) in AndroidManifest.xml.
Is there any other way than this, as when I press home button(after selecting the launcher as myapp) it is getting reloaded to the initial page of webview. )

It would be great help if anyone have any idea regarding it

Be the first to answer