View是所有控件的一个基类,无论是布局(Layout),还是控件(Widget)都是继承自View类.只不过layout是一个特殊的view,它里面创建一个view的数组可以包含其他的view而已. 这一篇文章把所有的layout和widget都统称为view,那么android是如何创建一个view的呢? 一.在代码中直接new出来. 比如说你要创建一个TextView的实例,那么你可以这样写: TextView text = new TextView(c); //c为context对象,…
一:init.rc文件修改 开机后运行一次: chmod 777 /system/bin/bt_config.sh service bt_config /system/bin/bt_config.sh class main user root group root oneshot 开机后等待android启动完成后再运行: service bt_config /system/bin/bt_config.sh class main user root group root disabled one…
一:如何自定义TextView实现滚动效果 继承TextView基类 重写构造方法 修改isFocused()方法,获取焦点. /* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the…
一:关机菜单添加飞行模式选项 源码路径:frameworks/base/core/res/res/values/config.xml 增加<item>airplane</item> <!-- Defines the default set of global actions. Actions may still be disabled or hidden based on the current state of the device. Each item must be o…
一 : 修改Android系统默认时间 源码路径:frameworks/base/services/java/com/android/server/SystemServer.java 主要变量EARLIEST_SUPPORTED_TIME // The earliest supported time. We pick one day into 1970, to // give any timezone code room without going into negative time. pri…