I 'am making an enterprise app, the user should be able to use only those applications which i provide him. My idea is overriding the default start screen with my custom layout with the app icons, of only those apps which i provide to the user. I will disable home, menu back and search buttons in the starting screen. Even if the user presses home button he should be redirected to my custom screen which contains icons.
I have seen an application which has achieved this without rooting the device. Here is the link for that app.
I just want to know how should i send the starting screen into background and my custom layout into foreground.
Your app seems like a custom launcher (but with restrictives permissions). So you can define your app as a launcher, to do that you can add this in the manifest :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:priority="1">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Then you have to implements a method to get back to the real launcher.
I 'am making an enterprise app, the user should be able to use only those applications which i provide him.
That needs to be a custom ROM.
I just want to know how should i send the starting screen into background and my custom layout into foreground.
Make your app be the home screen. There is an SDK sample available that shows how to create a home screen.
Q: How should I send the starting screen into background and my custom layout into foreground ?
A: Using BroadCastReceiver, you can achieve this through intent filter : android.intent.action.BOOT_COMPLETED
But, I am very curious to know, how did you override home key press functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With