随笔(四十六)

本文深入探讨了AndroidM的新特性Doze和AppStandby模式,提供了AlarmManager在不同Android版本的使用指南。详解了如何解决APP中90%的内存异常问题,分析了java.util.ArrayList$SubList无法转换为java.util.ArrayList的问题。介绍了ConstraintLayout2.0的特性和使用方法,包括按比例缩放View和Barrier的使用。同时,文章还讲解了SpannableString和SpannableStringBuilder的使用,以及Android中getColor()方法的替代方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.Android M新特性Doze and App Standby模式详解
https://zhuanlan.zhihu.com/p/20323263

Android各版本AlarmManager使用

https://www.jianshu.com/p/b39f9e79ac4f
2.
性能优化(三)看完这篇文章,至少解决 APP 中 90 % 的内存异常问题

https://juejin.im/post/5cd82a3ee51d456e781f20ce
3.java.util.ArrayList$SubList cannot be cast to java.util.ArrayList
https://blog.youkuaiyun.com/jam_yin/article/details/82351638
return listResult.size()>limit?new ArrayList<>(listResult.subList(0,limit)):listResult;
}2.
4.ConstraintLayout已经2.0了,你不来了解一下吗?

https://mp.weixin.qq.com/s/hPTYUKMROYYV0hI4xbKU3w
ConstraintLayout 介绍与实战

https://juejin.im/post/5ce3b68b518825336e0a5190
Android新特性介绍,ConstraintLayout完全解析

https://blog.youkuaiyun.com/guolin_blog/article/details/53122387

<?xml version="1.0" encoding="utf-8"?>

<android.support.constraint.ConstraintLayout xmlns:android=“http://schemas.android.com/apk/res/android
xmlns:app=“http://schemas.android.com/apk/res-auto
xmlns:tools=“http://schemas.android.com/tools
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:background="@color/quote_light_black"
android:paddingLeft=“16dp”
android:paddingRight=“16dp”
android:paddingTop=“8dp”
android:paddingBottom=“8dp”
>

<android.support.constraint.Guideline
    android:id="@+id/guideline"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    app:layout_constraintGuide_percent="0.62" />

<TextView
    android:id="@+id/tag_text"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:textColor="@color/white"
    app:layout_constraintEnd_toEndOf="@id/guideline"
    app:layout_constraintHorizontal_bias="0.492"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:text="苏宁尾" />

<TextView
    android:id="@+id/red_statistics"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:textColor="@color/search_article_statistics"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="@id/guideline"
    app:layout_constraintStart_toStartOf="parent"
    tools:text="2小时前 · 阅读1324" />

<ImageView
    android:id="@+id/imageView"
    android:layout_width="wrap_content"
    android:layout_height="87dp"
    android:layout_marginStart="8dp"
    android:layout_marginLeft="8dp"
    android:layout_marginTop="8dp"
    android:layout_marginBottom="8dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.428"
    app:layout_constraintStart_toEndOf="@+id/barrier"
    app:layout_constraintTop_toTopOf="parent"
    app:srcCompat="@drawable/img_default_news_large" />




<android.support.constraint.Barrier
    android:id="@+id/barrier"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    app:barrierDirection="right"
    app:constraint_referenced_ids="tag_text,red_statistics,guideline"
    tools:layout_editor_absoluteX="8dp" />

</android.support.constraint.ConstraintLayout>
5.Android 开发SpannableString和SpannableStringBuilder的使用详解
https://blog.youkuaiyun.com/baidu_31956557/article/details/78339071
6.
Android getResources().getColor() 过时 替代方法

https://blog.youkuaiyun.com/qq_22393017/article/details/54962660
ContextCompat.getColor(context, R.color.black);
(总是记不清替代方法是啥来着了,忘了三四次,干脆记录下
7.Android ConstraintLayout按比例缩放View
https://blog.youkuaiyun.com/zhangphil/article/details/79937497
关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。第二,恒定宽和高,另外一个方向就会按照比例缩放。
8.
ConstraintLayout之Barrier

http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2017/1017/8601.html
9.DxApplication onCreate走了两次
2019-07-03 17:12:33.201 6963-6963/com.yskj.hzfinance I/DxApplication: process name :com.yskj.hzfinance
2019-07-03 17:12:49.705 7149-7149/? I/DxApplication: process name :com.yskj.hzfinance:pushservice
原因:多进程模式中,不同进程的组件的确会拥有独立的
虚拟机、Application以及内存空间,
10.
Android Studio自带的抓图和录像功能

https://www.cnblogs.com/ztybc/p/9864756.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值