gpt4 book ai didi

android - 读取其他应用程序android的偏好

转载 作者:行者123 更新时间:2023-11-30 03:10:39 25 4
gpt4 key购买 nike

我了解到可以从我的应用程序外部检索共享首选项。此代码无效:

try 
{
myContext = createPackageContext("com.intervigil.micdroid", Context.MODE_WORLD_WRITEABLE); // where com.example is the owning app containing the preferences
SharedPreferences testPrefs = myContext.getSharedPreferences("test_prefs", Context.MODE_WORLD_READABLE);
Map<String, ?> items = testPrefs.getAll();
nbenroullement= (Integer) items.get("enroullement");
System.out.println("*********************" + nbenroullement);
}
catch (NameNotFoundException e)
{
e.printStackTrace();
}

请任何人帮助我。谢谢

最佳答案

最后我在本教程中得到了解决方案我希望我能帮助你 http://androiddhamu.blogspot.in/2012/03/share-data-across-application-in.html

关于android - 读取其他应用程序android的偏好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21038632/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com