简体   繁体   中英

How to reboot the app system without restarting the device?

I want to be able to restore all the app that are installed on the device, I have this need because my application fulfills the function of adding and removing data from the directories of the user applications that are /data/app /data/data and /data/dalvik-cache . For the reason that the system does not recognize that it is there if not until the device is restarted and I need to be able to run those added files, or update those deleted files so that they do not appear as existing.


Actually, I have no idea how to create a similar method and I do not know any class of android or java that allows what I want to achieve.

If you know anything, on this subject to help me clear the path that is obstructed by doubts. Please let me know. Thank you.

Maybe root access is required for this to work.

Runtime.getRuntime().exec("su & pm clear " + packagename);

You can also use array of commands(String[] cmds) and execute them using Runtime. Use adb shell or terminal emulater (prefered). Type "pm" and hit enter to learn more. Just don't use it for any wrong purpose

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM