J2ME: lock the device programmatically

934 Views Asked by At

I am working in J2ME. I want to lock device programmatically. Only one screen (in which text field for password and one button to unlock ) must show. If user press END button then it must not work.

For example suppose my application is running in device(Mobile) then if any person get this device he must enter password, then he can use that device other wise he can do nothing(neither call nor anything).

Please suggest how can I do this.

2

There are 2 best solutions below

0
On

Sorry to inform you, there's absolutely no way to do this in J2ME.

3
On

I have solved this problem.

This is the main code to solve this problem:-

 protected void hideNotify() {

        Display.getDisplay(myMidlet).setCurrent(null);
        super.hideNotify();
    Thread thread = new Thread(new Runnable() {
    public void run() {

                Display.getDisplay(myMidlet).setCurrent(new LockScreen(myMidlet));
            }
     }
     );
     thread.start();


    }

I write this code into my LockScreen canvas. So only lock screen is displaying , if user press end button then it shows that lock screen and again.