随笔分类 -  工作需要———安卓app学习

摘要:布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" 阅读全文
posted @ 2022-07-16 18:12 小白龙白龙马 编辑
摘要:首页布局; <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent 阅读全文
posted @ 2022-07-16 17:02 小白龙白龙马 编辑
摘要:第一个页面布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_par 阅读全文
posted @ 2022-07-16 15:01 小白龙白龙马 编辑
摘要:第一个布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_paren 阅读全文
posted @ 2022-07-16 13:36 小白龙白龙马 编辑
摘要:// 初始化下拉模式的列表框 private void initSpinnerForDropdown() { // 声明一个下拉列表的数组适配器 ArrayAdapter<String> starAdapter = new ArrayAdapter<String>(this,R.layout.ite 阅读全文
posted @ 2022-07-16 13:07 小白龙白龙马 编辑
摘要:Java代码可利用自定义Application的静态成员变量实现全局变量的功能。具体需要完成以下3项工作: (1)写一个继承自Application的类MainApplication。该类要采用单例模式,内部声明自身类的一个静态成员对象,然后提供该静态对象的获取方法getInstance。 (2)在 阅读全文
posted @ 2022-07-11 00:12 小白龙白龙马 编辑
摘要:Application是Android的一大组件,在App运行过程中有且仅有一个Application对象贯穿整个生命周期。 在AndroidManifest.xml里面,activity节点的上级正是application节点。如果给application节点指定android:name属性,则表 阅读全文
posted @ 2022-07-10 23:45 小白龙白龙马 编辑
摘要:第一个布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_paren 阅读全文
posted @ 2022-07-10 19:00 小白龙白龙马 编辑
摘要:添加权限: <!-- 存储卡读写 --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.RE 阅读全文
posted @ 2022-07-10 18:31 小白龙白龙马 编辑
摘要:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andr 阅读全文
posted @ 2022-07-10 17:59 小白龙白龙马 编辑
摘要:第一个界面: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_paren 阅读全文
posted @ 2022-07-10 17:32 小白龙白龙马 编辑
摘要:// 下面是利用共享参数保存密码的代码 // 如果勾选了“记住密码”,则把手机号码和密码都保存到共享参数中 if (bRemember) { SharedPreferences.Editor editor = mShared.edit(); // 获得编辑器的对象 editor.putString( 阅读全文
posted @ 2022-07-10 16:29 小白龙白龙马 编辑
摘要:共享参数的用法 SharedPreferences是Android的一个轻量级存储工具,采用的存储结构是Key-Value的键值对方式。 共享参数的存储介质是符合XML规范的配置文件。保存路径是:/data/data/应用包名/shared_prefs/文件名.xml 下面是一个共享参数的XML文件 阅读全文
posted @ 2022-07-10 15:37 小白龙白龙马 编辑
摘要:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andr 阅读全文
posted @ 2022-07-10 13:30 小白龙白龙马 编辑
摘要:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andr 阅读全文
posted @ 2022-07-10 13:02 小白龙白龙马 编辑
摘要:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andr 阅读全文
posted @ 2022-07-10 12:20 小白龙白龙马 编辑
摘要:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andr 阅读全文
posted @ 2022-07-10 11:56 小白龙白龙马 编辑
摘要:// 焦点变更事件的处理方法,hasFocus表示当前控件是否获得焦点。 // 为什么光标进入事件不选onClick?因为要点两下才会触发onClick动作(第一下是切换焦点动作) public void onFocusChange(View v, boolean hasFocus) { // 判断 阅读全文
posted @ 2022-07-10 11:07 小白龙白龙马 编辑
摘要:EditText是文本编辑框,用户可在此输入文本等信息。 EditText的常用属性说明如下:(1)、inputType:指定输入的文本类型。若同时使用多种文本类型,则可使用竖线“|”把多种文本类型拼接起来。(2)、maxLength:指定文本允许输入的最大长度。(3)、hint:指定提示文本的内容 阅读全文
posted @ 2022-07-09 19:21 小白龙白龙马 编辑
摘要:<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" androi 阅读全文
posted @ 2022-07-09 18:49 小白龙白龙马 编辑