Opening specific part of system settings from app

南楼画角 提交于 2019-12-31 06:32:28

问题


I have a shortcut from my app which opens the storage part of system settings, (which works perfectly), but if the settings app is already running, and was last left from say the display settings, you don't get directed to the storage settings, but the display settings, when pressing the shortcut.

Is there a way to force opening storage settings, or say close (if not closed) the settings app, before trying to launch the storage?

I am using the intent android.settings.INTERNAL_STORAGE_SETTINGS to start the activity.


回答1:


try setting the following flag on your intent:

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);


来源:https://stackoverflow.com/questions/13385409/opening-specific-part-of-system-settings-from-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!