Android基础知识
daitu_liang
年轻就应该拼着
展开
-
git
1、commit后,想修改提交的描述信息,若是当前有修改的代码方案一:先保存修改代码git stash,再去修改commit的信息,git commit --amend,进行修改描述, esc退出编辑状态,wq保存,最后再执行git stash pop 取出当前修改的代码;方案二:同理保存当前改动代码,git stash ,git:local changes,shelf ,Log:all;切换到Log:all下,选中刚才commit,右击undo commit,进行修改,再重新commit2、提原创 2021-01-14 14:32:48 · 348 阅读 · 0 评论 -
App 启动时间
了解应用程序-启动内部内容冷起动冷启动指的是应用程序从头开始:这个开始,系统的进程才创建了应用程序的进程。冷启动发生在这样的情况下,例如您的应用程序是在设备启动后,首次启动的,或者是在系统关闭应用程序后启动的。这种类型的启动在减少启动时间方面提出了最大的挑战,因为系统和应用程序要比其他启动状态下有更多的工作要做。在冷启动的开始阶段,系统有三个任务:加载并启动应用程序。 启动后立即显...原创 2018-12-25 15:57:56 · 687 阅读 · 0 评论 -
onActivityResult中resultCode老是等于0
今天在项目发现,我在onActivityResult等返回resultCode总是0,想不通,更奇怪的在乐视1s手机上,却可以正常返回resultCode,在三星GT-N7100上不行,老是resultCode=0,同样的代码,在两个不同手机出现不一样的结果,反正不是我想看到的,最后网上找了些资料看了下,是和acitivty的launchMode有关,我两个activity A和B,都是lau原创 2016-12-02 16:08:51 · 5596 阅读 · 0 评论 -
The currently selected variant "debug" uses split APKs, but none of the 1 split apks are compatible
在Android studio模拟机上运行apk,失败,报错,The currently selected variant "debug" uses split APKs, but none of the 1 split apks are compatible with the current device with density "420" and ABIs "x86".解决方法:需要在a原创 2016-09-18 17:36:23 · 10898 阅读 · 0 评论 -
CheckBox
首先res/drawable中: 文件名称:check_box_bg.xml 在布局里<CheckBox android:id="@+id/check_box" android:layout_width="wrap_content" android:layout_height="wrap_co原创 2016-09-18 10:39:43 · 460 阅读 · 0 评论 -
解决Android调用系统相机拍照后相片无法在相册中显示问题
目前自己使用发送广播实现了效果,后续学习再整理,此刻忙public void photo() { Intent openCameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(openCameraIntent, TAKE_PICTURE); }p原创 2016-03-23 15:50:49 · 5916 阅读 · 1 评论 -
Android中如何判断app是否在前台
public static boolean isAppInForeground(Context context) { ActivityManager am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); List tasks = am.getRunningTasks(1); if原创 2015-12-24 15:53:59 · 864 阅读 · 0 评论 -
Android中获取屏幕信息DisplayMetrics的用法
创建个工具类MyUtils方便使用 public static DisplayMetrics getScreenMetrics(Context context) { WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); DisplayMetric原创 2015-12-05 18:37:39 · 2346 阅读 · 0 评论 -
Android中PopupWindow的基本使用
PopupWindow在界面弹出一窗口,效果相信大家常常看到,不废话,下面代码,有简单的先来。分三种使用方式:1.直接相对某个控件弹出实现代码:布局:popu_bg.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schem原创 2015-11-11 15:04:46 · 1403 阅读 · 0 评论