Android
小风筝123
^_^
展开
-
RecyclerView使用GridLayoutManager 设置间距一致大小
在android应用中,要实现一个Recycleview,使用GridLayoutManager格子排列,且排列成4列实现水平方向间距均等(没有外边距)。(均分为3列5列等、竖直方向、有边距等原理相同。)先看最终效果图。---xml中这样配置为了醒目,我们让RecyclerView背景是浅绿色。每一个item的配置如layout_item.xml所示为了醒目,我们让每一个item的背景色为浅红色。Activity中,我们这样设置这样的显示效果,就是,最左边item的左边距离0,原创 2022-06-23 15:56:38 · 9160 阅读 · 1 评论 -
用signapk.jar给apk签名失败UnsatisfiedLinkError,IllegalArgumentException
用signapk.jar给apk签名失败,jdk1.8时android N源码里,$ java -jar out/host/linux-x86/framework/signapk.jar \.../platform.x509.pem .../platform.pk8 .../testapp-debug.apk .../testapp-debug_signed.apkException in thread "main" java.lang.UnsatisfiedLinkError: no conscr原创 2021-09-15 16:24:30 · 998 阅读 · 0 评论 -
Didn‘t find class com.tencent.tauth.Tencent android app缺少qq微信sdk导致crash
app crash了E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/tencent/tauth/Tencent;...java.lang.ClassNotFoundException: Didn't find class "com.tencent.tauth.Tencent" 把qq的sdkopen_sdk_3.5.5.79_ra741783e_lite.jar放进libs下,此时app不会原创 2021-08-30 09:53:12 · 1523 阅读 · 0 评论 -
android xx.xml includes views not allowed in a RemoteView自定义通知布局
通知自定义layout失败@layout/xxx.xml includes views not allowed in a RemoteViewNotification的自定义布局是RemoteViews,和其他RemoteViews一样,在自定义视图布局文件中,仅支持FrameLayout、LinearLayout、RelativeLayout三种布局和AnalogClock、Chronometer、Button、ImageButton、ImageView、ProgressBar、TextView、V原创 2021-08-30 09:45:44 · 1079 阅读 · 0 评论 -
android判断是否是深色模式
判断系统是否是深色模式和判断当前app是否是深色模式不一样。系统是深色模式,但此app自己代码单独设置了不是深色模式,(用下列代码设置成非深色模式AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);)此时 UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);原创 2021-08-30 09:40:47 · 5744 阅读 · 2 评论 -
出现Immutable bitmap passed to Canvas constructor
Immutable bitmap passed to Canvas constructor操作bitmap出现crash.上code: private void setBluredBackground(View root) { WindowManager wm = (WindowManager) mContext.getSystemServ原创 2017-04-18 15:41:01 · 5896 阅读 · 0 评论 -
AndroidStudio里查看hprof文件
AndroidStudio里查看hprof文件打开AndroidStudio,打开Android Device Monitor,即AndroidStudio -> Tools -> Android -> Android Device Monitor,选择要dump的进程,点击 "Dump HPROF file"这样就得到 了hprof文件。AndroidStudio原创 2017-03-02 21:27:47 · 9310 阅读 · 0 评论 -
android 获取HOME组件的Activity信息
Android Activity里如何获取当前桌面是什么包什么类上code: protected void handleClick() { Intent intent = new Intent(); intent.setAction(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEG原创 2017-03-02 21:09:40 · 1081 阅读 · 0 评论 -
Could not reserve enough space for 1572864KB object heap
Error:Unable to start the daemon process.This problem might be caused by incorrect configuration of the daemon.For example, an unrecognized jvm option is used.Please refer to the user guide chap原创 2017-01-11 09:56:12 · 1817 阅读 · 0 评论 -
修改FloatingActioButton应用
现有一个图标图标是一个白圈圈包裹一个垃圾桶。如果用FloatingActioButton来做,<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_原创 2017-02-20 20:19:37 · 253 阅读 · 0 评论 -
android:layout_height="match_parent"和android:layout_marginTop="100dp"同时作用
如果同时设置android:layout_height="match_parent" 和 android:layout_marginTop,会怎么样?xml文件<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.andr原创 2017-02-16 19:16:31 · 3143 阅读 · 0 评论