安卓
九段刀客
你期待的并且相信的,终将实现!
展开
-
安卓实现weibview并监听返回
webview页面 src/main/src/layout/activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-原创 2021-09-17 19:10:59 · 787 阅读 · 0 评论 -
安卓入门,写一个Hello World APP,从零到打包成App
1、安装android studio 直接官网下载默认方式安装就可以了 这里推荐个b站的安卓视频,也可以跟着视频来 https://www.bilibili.com/video/BV13y4y1E7pF?p=1 2、新建项目 然后需要等一下,需要生成代码什么的。 3、修改源 代码生成结束后会报错,这个时候就需要修改源 android Studio unable to find valid certification path to requested target 这里切换成project模式文件原创 2021-06-17 17:30:06 · 435 阅读 · 0 评论 -
安卓学习笔记六:LinearLayout布局、View设置分割线
1、控制水平竖向排列orientation 相当于css的dipaly:flex,和display:flex;flex-direction: column; android:orientation="horizontal"水平排列(默认) -android:orientation="vertical"竖向排列 2、gravity对齐方式 android:gravity=“center_vertical” 垂直居中 android:gravity=“center_horizontal” 水平居中 .原创 2021-06-24 13:58:20 · 450 阅读 · 1 评论 -
安卓学习笔记五:service的使用
service用于后台运行,比如音乐播放器后台播放音乐,service有两种startService和bindService,前者用于与ui线程没有交互的场景,后者由于有交互的场景。这里主要介绍startService public void startService1(View view) { Log.d(TAG,TAG+ "开始service1"); startService(new Intent(this,Service1.class)); } public原创 2021-06-22 15:52:58 · 56 阅读 · 0 评论 -
安卓学习笔记四:activity生命周期(对比vue和uni-app的生命周期)
1、onCreate 初始化 相当于vue里面的created生命周期,初始化第一次进入时触发。和uni-app的onLoad生命周期是一样的。 2、onRestart 重启 相对于uni-app的onShow`生命周期,跳转到别的界面再返回时会触发,回到桌面再回来也会触发,先触发onRestart再触发onResume 3、onResume 显示 相当于uni-app的onShow生命周期。vue的mounted,先触发onReate或onRestart再触发onResume 4、onPause 暂停原创 2021-06-22 14:25:05 · 1115 阅读 · 0 评论