java - android eclipse lock screen app full screen -


before sorry bad english.

i search lot site not found answer.sorry

i make lock-screen app.(for android 4.0+) make "service" call "broadcast receiver". in "broadcast receiver" happen :

if(screen_off) else if(screen_on) else if(boot_completed))

i start main activity (my main lock-screen application).

until moment thing work , device lock , unlock correctly.


but there problem.

1 : how set app default lock-screen app?

2 : when device lock if press "home button","back button","recent button", transfer home screen , lock-screen go recent normal application , access device without security.

2-1 : in android 4.0+ can not override "home button".


my solution problem 2: search in developer.google , find below method draw "view" on other apps permission : <uses-permission android:name="android.permission.system_alert_window"/>

 windowmanager = (windowmanager) getsystemservice(window_service);        windowmanager.layoutparams params = new windowmanager.layoutparams(               windowmanager.layoutparams.match_parent,               windowmanager.layoutparams.match_parent,               windowmanager.layoutparams.type_system_overlay,               windowmanager.layoutparams.flag_layout_in_screen,               pixelformat.translucent);       windowmanager = (windowmanager) getapplicationcontext().getsystemservice(context.window_service);       layoutinflater li = (layoutinflater) getsystemservice(layout_inflater_service);      linearlayout mtopview = (linearlayout) li.inflate(r.layout.activity_main_lock, null);       windowmanager.addview(mtopview, params); 

but method draw xml file on other apps. want activity.


i use flags button still working :(

getwindow().addflags(windowmanager.layoutparams.flag_dismiss_keyguard|windowmanager.layoutparams.flag_show_when_locked|windowmanager.layoutparams.flag_fullscreen); 

please , if have idea how make activity on other apps.

please me solve problem thank much.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -