![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ANDROID
文章平均质量分 70
七星嫖虫
一 if 一 else 一世界。
展开
-
【ANDROID】Android 在oncreate() 方法中调用 findViewById 返回 null 问题的原因和解决方法
Android 在oncreate() 方法中调用 findViewById 返回 null 问题的原因和解决方法 原因分析: oncreate() 方法用于初始化页面,只有完成oncreate(Bundle) 方法后,页面中的控件才能通过findViewById方法获取到。 在网上查询解决方案时,有下面这种解决方案: setContentView(id); findV转载 2015-01-08 16:02:25 · 539 阅读 · 1 评论 -
【ANDROID】Logcat中添加自己调试代码信息
步骤: 1,在Activity里申明tag变量(名字其实是随便的,如下: private static final String tag="yan"; 2,需要使用logcat输出信息时: Log.i(tag, "屏幕宽度:"+display.getWidth()+" 屏幕高度:"+display.getHeight()); 3, 双击Logcat,点击“+”号add a转载 2015-01-08 16:21:06 · 304 阅读 · 0 评论 -
【ANDROID】EditText需要指定默认输入类型
例如:android:inputType="number|phone",表示指定为数字或电话 inputtype类型如下: //文本类型,多为大写、小写和数字符号。 android:inputType="none" android:inputType="text" android:inputType="textCapCharacters" androi转载 2015-01-08 16:11:49 · 465 阅读 · 0 评论