I think that is a bad idea. I think you need to create an application that can run over the lock screen.
In you main FragmentActivity you must add the next windows flags:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layout);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
If your device has home physical button, so you need add to your AndroidManifest flags for launcher application:
<activity
android:name="YourFragmentActivity"
android:label="@string/app_name"
android:theme="@style/MyTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
You must add a locking method to your device (pin, pattern, etc). Then start your application, press lock button (screen will be off), press lock button newly. And your app will be over the lockscreen. (and no one can enter to settings)
To avoid the exit:
@Override
public void onBackPressed() {
if (firstfragment.isVisible()) { //first fragment loaded in your backstack
} else {
super.onBackPressed();
}
}
UPDATE
Here a video showing how work this:
http://www.youtube.com/watch?v=ZtNAAVy_nWY
PD: Sorry my english is bad.