会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
于光远
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
19
下一页
2020年7月7日
android SQLite 使用
摘要: https://www.cnblogs.com/ljy-1471914707/p/5444531.html package com.example.sql1; import android.content.Context; import android.database.sqlite.SQLiteD
阅读全文
posted @ 2020-07-07 21:04 于光远
阅读(319)
评论(1)
推荐(0)
2020年7月3日
handler
摘要: https://www.jianshu.com/p/f70ee1765a61 如何判断当前线程是不是主线程 Looper.myLooper() == Looper.getMainLooper() Looper.getMainLooper().getThread() == Thread.current
阅读全文
posted @ 2020-07-03 20:19 于光远
阅读(365)
评论(0)
推荐(0)
2020年7月2日
fragment 给 activity 传数据
摘要: //Fragment向Activity传值(接口回调) //1.定义一个接口,在该接口中声明一个用于传递数据的方法 //2.让Activity实现该接口,然后重写回调方法,获取传入的值,然后做处理 //3.在自定义Fragment中,声明一个回调接口的引用 //4.在onAttach中法中,为第三步
阅读全文
posted @ 2020-07-02 20:09 于光远
阅读(274)
评论(0)
推荐(0)
activity 给 fragment 传递数据
摘要: 在activity中加载 frament,并传递给它参数 //setArguments //1.实例化Fragment Fragment f1 = new Fragment1(); //2.实例化一个Bundle对象 Bundle bundle = new Bundle(); //3.存入数据到Bu
阅读全文
posted @ 2020-07-02 19:02 于光远
阅读(1572)
评论(0)
推荐(0)
fragment (动态加载)
摘要: 动态加载,就是使用代码进行加载,不指定name属性。 使用帧布局元素,进行覆盖显示。 添加一个fragement需要4个步骤。 1.获取Fragment管理器 2.获取Fragment事务(/开启事务) 3.动态添加Fragment //参数1:容器id //参数2:Fragment对象 4.提交事
阅读全文
posted @ 2020-07-02 15:04 于光远
阅读(1482)
评论(0)
推荐(0)
fragment (静态)
摘要: 首先创建一个hello world工程。 然后创建一个空的fragment 给fragment_1.xml 加上背景色。 把fragment放进activity_main.xml 显示,指定fragment位置和大小,通过name属性,关联到fragment1.java 结果:
阅读全文
posted @ 2020-07-02 13:59 于光远
阅读(203)
评论(0)
推荐(0)
2020年7月1日
Android:layout_weight的深入理解
摘要: https://www.jianshu.com/p/0ecd9998fcf9 线性布局,理解layout_weight https://www.w3cschool.cn/uawnhh/iv2b4ozt.html
阅读全文
posted @ 2020-07-01 15:10 于光远
阅读(153)
评论(0)
推荐(0)
startActivityForResult 和 onActivityResult
摘要: 参考:https://blog.csdn.net/hellobenji/article/details/79978701 https://www.jianshu.com/p/5f3953bc012e 在开发项目过程中,startActivityForResult是最常见的,它的使用场景就是:比如从A
阅读全文
posted @ 2020-07-01 13:59 于光远
阅读(300)
评论(0)
推荐(0)
activity 之间传递参数
摘要: 参考:http://c.biancheng.net/view/2923.html mainActivity中 通过intent 传递参数 class MyClickListener implements View.OnClickListener{ @Override public void onCl
阅读全文
posted @ 2020-07-01 12:01 于光远
阅读(370)
评论(0)
推荐(0)
手动创建一个Activity,完成页面跳转(intent 无参数)
摘要: 使用android-studio创建一个empty activity 参考: https://blog.csdn.net/qq_39504605/article/details/80630887 AndroidManifest.xml <?xml version="1.0" encoding="ut
阅读全文
posted @ 2020-07-01 10:48 于光远
阅读(306)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
19
下一页
公告