Android 应用程序中-设置-蓝牙,隐藏蓝牙功能
2014-06-19 14:45
295 查看
1.通过搜索">Bluetooth<"找到相关的定义
Settings\res\values\String.xml
./res/values/strings.xml:206: <string name="bluetooth">Bluetooth</string>
./res/values/strings.xml:958: <string name="bluetooth_quick_toggle_title">Bluetooth</string>
./res/values/strings.xml:962: <string name="bluetooth_settings">Bluetooth</string>
./res/values/strings.xml:964: <string name="bluetooth_settings_title">Bluetooth</string>
./res/values/strings.xml:2940: <string name="power_bluetooth">Bluetooth</string>
2.通过bluetooth_settings定义名字找到相关的xml文件
Settings\res\xml\settings_headers.xml
<!-- Bluetooth -->
<header
android:id="@+id/bluetooth_settings"
android:fragment="com.android.settings.bluetooth.BluetoothSettings"
android:title="@string/bluetooth_settings_title"
android:icon="@drawable/ic_settings_bluetooth2" />
3.通过ID,@+id/bluetooth_settings(R.id.bluetooth_settings)找到相关的Java文件
Settings\src\com\android\settings\Settings.java
private void updateHeaderList(List<Header> target) {//更新Header列表
if (id == R.id.bluetooth_settings) {
// Remove Bluetooth Settings if Bluetooth service is not available.
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
target.remove(header);
}
改为:当为真的时候都去移除蓝色选项
if (id == R.id.bluetooth_settings) {
// Remove Bluetooth Settings if Bluetooth service is not available.
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
target.remove(header);
}
相关文章推荐
- android 蓝牙设置界面高级选项功能解析
- Android标题栏和状态栏的隐藏功能设置方法
- Android - 小功能 - EditText设置/隐藏光标位置、选中文本和获取/清除焦点
- android应用程序跳转到系统的各个设置页面和通过Intent action 跳转到系统页面,调用系统功能以及action
- Android提高第十三篇之探秘蓝牙隐藏API
- 实现android应用程序退出功能
- Android应用程序开发教程:实现一个功能比较完善的登录对话框
- Android 设置EditText显示或隐藏密码
- android G1蓝牙与无线网络,APN接入点设置
- Android平台开发-Bluez function porting-蓝牙功能移植
- android应用程序更新功能实现
- Android提高第十三篇之探秘蓝牙隐藏API
- Android开发之--(WIFI,蓝牙,电池,背光,SD卡,摄像头,按键,MIC,重力感应等)功能的简单使用
- Android Activity 常用功能设置(全屏、横竖屏等)
- Android提高第十三篇之探秘蓝牙隐藏API
- android-设置蓝牙的可见性
- Android笔记四 虚拟机Dalvik、Android各种java包功能、Android相关文件类型、应用程序结构分析、ADB
- Android应用程序权限设置
- eBook 功能模块二之设置模块Android
- Android Activity 常用功能设置(全屏、横竖屏等)