Can't bypass home button delay with root access
I'm developing an app for private use. The problem is that the service I'm using to launch an activity when 开发者_开发问答the home button is pressed, still suffers from the 5-second delay. I used this code to grant root, and verified by turning on superuser toast notifications:
try {
Runtime.getRuntime().exec("su");
} catch (IOException exception) {
exception.printStackTrace();
}
Do I need to do anything else for it to bypass the rule? I am not going to use a home helper, it prevents android system from keeping LauncherPro in memory and running properly.
What 5-seconds delay are you talking about? There is no such thing on Android. The only thing that I can think of the 5 seconds time limit before you get an ANR. If you spend more than 5 seconds performing an action on the UI thread, an ANR error is presented to the user.
If you mean the delay from when the user presses home to return to the home screen and someone else can launch an activity to switch them away from it, this is part of the core platform and just running as root doesn't magically make it disappear.
in widgetlocker advanced menu there is a root helper and then you can disable the 5 second timeout.
精彩评论