在Android设置得到ownerinfo编程 [英] get ownerinfo in android settings programatically
本文介绍了在Android设置得到ownerinfo编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法从ownerinfo获得下的Android安全设置设备名。我发现这个方法
Is there a way to get devicename from ownerinfo under secure settings of android. I found this way
String deviceName = Settings.Secure.getString(getActivity().getContentResolver(), Settings.Secure.LOCK_PATTERN_OWNER_INFO);
但在devlopers站点没有可用的这样的常数。难道是去precated?我用Google搜索,但没有找到合适的答案。
but in the devlopers site there is no such constant available. Is it deprecated? i have googled but could not find the appropriate answer.
我采用了android 4.1版本
I am using android 4.1 version
推荐答案
使用
String ownerInfo = Settings.Secure.getString(getContentResolver(), "lock_screen_owner_info");
请一定要抓住<一个href=\"https://developer.android.com/reference/android/provider/Settings.SettingNotFoundException.html\"相对=nofollow> SettingNotFoundException
Make sure to catch SettingNotFoundException
这篇关于在Android设置得到ownerinfo编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文