二叉树的遍历
二叉树遍历 递归算法 BinaryTree.h // // Created by Administrator on 2021/10/25. // #ifndef TEST_BINARYTREE_H #define TEST_BINARYTREE_H #include <iostream> using namespace std; typedef char E...
二叉树遍历 递归算法 BinaryTree.h // // Created by Administrator on 2021/10/25. // #ifndef TEST_BINARYTREE_H #define TEST_BINARYTREE_H #include <iostream> using namespace std; typedef char E...
ListView list_item.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vert...
Button 触发事件 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_hei...
Service 组件必须注册 服务并不是运行在一个独立的进程中,而是依赖于创建服务时所在的应用程序进程中。应用程序被杀死时,所有依赖它的服务都会停止 要在服务的内部创建子线程执行具体任务,否则默认运行在主线程,有可能出现主线程被阻塞的情况 activity_my2.xml <?xml version="1.0" encoding="utf-8"?> <...
Service Service既不是一个线程,Service通常运行在当成宿主进程的主线程中,所以在Service中进行一些耗时操作就需要在Service内部开启线程去操作,否则会引发ANR异常。 也不是一个单独的进程。除非在清单文件中声明时指定进程名,否则Service所在进程就是application所在进程。 生命周期 ...
RecyclerView刷新方式 刷新全部item notifyDataSetChanged() student.setValue(new Student("二狗")); studentList.add(student.getValue()); myRecyclerViewAdapter.notifyDataSetChanged(); 刷新指定item notify...
Notification <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="sendNotification" android:text="发送通知"/> <Button android...
Navigation 基本操作 activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android...
LinearLayout layout_gravity:组件在父容器里的对齐方式 gravity:组件包含的所有子元素的对齐方式 layout_weight:在原有基础上分配剩余空间,一般把layout_height都设置为0dp再使用此属性 设置分割线可以用divider属性,或者插入View <?xml version="1.0" encoding="utf...
Intent 用于启动Activity,启动Service,发送广播 显式Intent Intent(Context, Class) 构造函数分别为应用和组件提供 Context 和 Class 对象。因此,此 Intent 将显式启动该应用中的 DownloadService 类。 Intent downloadIntent = new Intent(this, D...