![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
系统应用Settings
marton_13
共勉
展开
-
android 7 去掉设置中建议栏选项,即去掉Suggestion
packages/apps/Settings/src/com/android/settings/dashboard/DashboardAdapter.javaprivate void recountItems() { reset(); boolean hasConditions = false; for (int i = 0; mConditions != null && i < mConditions.size(); i++) {原创 2021-04-27 15:13:27 · 1018 阅读 · 0 评论 -
Android 获取已开机时间
public String getUpTime() { long upTime = SystemClock.elapsedRealtime()/1000; return convert(upTime); } private String convert(long t) { int s = (int)(t % 60); int ...原创 2020-03-06 15:38:14 · 2815 阅读 · 0 评论 -
Android7.1 settings取消侧滑菜单
frameworks/base/packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.javapublic boolean onOptionsItemSelected(MenuItem item) { //或者mShowingMenu=false if (mShowingMenu && mDrawerLayout != null && item.getItemId()原创 2020-12-02 11:06:02 · 423 阅读 · 0 评论 -
Android 7.1 settings中开发者选项开关 笔记
packages/apps/Settings/src/com/android/settings/DevelopmentSettings.javaprivate SwitchBar mSwitchBar;Settings.Global.putInt(getActivity().getContentResolver(), Settings.Global....原创 2019-11-29 12:03:29 · 1975 阅读 · 0 评论 -
Android N 设置源码分析
Settings的主界面frameworks/base/packages/SettingsLib/res/layout/settings_with_drawer.xml&amp;amp;amp;amp;amp;amp;amp;lt;android.support.v4.widget.DrawerLayout xmlns:android=&amp;amp;amp;amp;amp;amp;quot;http://schemas.android.com/apk/r原创 2019-02-16 09:53:45 · 835 阅读 · 0 评论 -
Android 7.1 添加一个设置选项
根据需求,在设置界面添加一个设置选项“USB设置”1、packages/apps/Settings/AndroidManifest.xml 添加Activity信息&lt;!-- UsbDeviceSettings --&gt;&lt;activity android:name="Settings$UsbDeviceSettingsActivity" android:lab...原创 2018-07-04 20:38:45 · 2767 阅读 · 3 评论