How To Load Previous Activity Which Is Running In Background

by Reghu » Tue, 28 Apr 2009 15:47:22 GMT


Sponsored Links
 Hello,

Is there any way to load previous activity which is running in
background.

Thank you
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Sample mobile application query

Hi,
        Can you please tell me about the security management in mobile
banking application?
-- 
Warm Regards,
Sudeep

--~--~---------~--~----~------------~-------~--~----~

2. Activate Unlock Pattern

Hello,

For a project that I am working on I want to use Android's unlock
pattern for security purposes.
So, I need to lock the screen, trigger the unlock pattern, and
callback the result to my application.

I have tried the WAKE_LOCK (Power Manager) to lock the screen and
intercept it using Keyguard Manager but following code did not work on
me properly.

I will be happy if someone advice proper solution.

public class ManageKeyguard {
    private static KeyguardManager myKM = null;
    private static KeyguardLock myKL = null;

    public static synchronized void initialize(Context context) {
            if (myKM == null) {
                    myKM = (KeyguardManager) context.getSystemService
(Context.KEYGUARD_SERVICE);
            }

            PowerManager PM = (PowerManager) context.getSystemService
(Context.POWER_SERVICE);
            PowerManager.WakeLock WL = PM.newWakeLock
(PowerManager.PARTIAL_WAKE_LOCK, "myKMLog");
            WL.acquire();
    }

    public static synchronized void disableKeyguard(Context context) {
            initialize(context);

            if (myKM.inKeyguardRestrictedInputMode()) {
                    myKL = myKM.newKeyguardLock("myKMLog");
                    myKL.disableKeyguard();
                    System.out.println("--Keyguard disabled");
            } else {
                    myKL = null;
            }
    }

    public static synchronized boolean inKeyguardRestrictedInputMode()
{
            if (myKM != null) {
                    System.out.println("--
inKeyguardRestrictedInputMode = " + myKM.inKeyguardRestrictedInputMode
());
                    return myKM.inKeyguardRestrictedInputMode();
            }
            return false;
    }

    public static synchronized void reenableKeyguard() {
            if (myKM != null) {
                    if (myKL != null) {
                            myKL.reenableKeyguard();
                            myKL = null;
                            System.out.println("--Keyguard
reenabled");
                    }
            }
    }

    public static synchronized void exitKeyguardSecurely(final
LaunchOnKeyguardExit callback) {
            if (inKeyguardRestrictedInputMode()) {
                    System.out.println("--Trying to exit keyguard
securely");
                    myKM.exitKeyguardSecurely(new OnKeyguardExitResult
() {
                            public void onKeyguardExitResult(boolean
success) {
                                    reenableKeyguard();
                                    if (success) {
                                            System.out.println("--
Keyguard exited securely");
 
callback.LaunchOnKeyguardExitSuccess();
                                    } else {
                                            System.out.println("--
Keyguard exit failed");
                                    }
                            }
                    });
            } else {
                    callback.LaunchOnKeyguardExitSuccess();
            }
    }

    public interface LaunchOnKeyguardExit {
            public void LaunchOnKeyguardExitSuccess();
    }
}

Regards,
Niklaus

--~--~---------~--~----~------------~-------~--~----~

3. Forward Locking A Specific Downloaded File

4. Android Phone

5. How to load the developer image under a rooted G1?

6. Hi.. getting error in creating AVD

7. JDOM 1.1.1 could not load default SAX parser with android sdk-windows-1.5_r3