- 博客(32)
- 资源 (5)
- 收藏
- 关注
原创 竖屏activity_a跳转横屏activity_b,activity_b页面关闭返回activity_a,activity_a会先显示竖屏再显示横屏最后显示竖屏
activity横竖屏跳转问题,多次旋转,横竖屏切换
2022-06-02 07:55:39
485
原创 Android開發 WebView优化方案
public class X5WebView extends WebView { public X5WebView(Context arg0) { this(arg0,null); } public X5WebView(Context arg0, AttributeSet arg1) { super(arg0, arg1); setBackgroundColor(85621); if (!isInEditMo...
2022-05-12 10:14:12
675
原创 Android开发shape渐变阴影
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"><!-- 边--> <item> <shape android:shape="rectangle"> <padding androi.
2022-04-25 12:45:53
2168
原创 安卓自定义进度条,自定义圆形进度条
自定义view实现进度条import android.annotation.SuppressLint;import android.content.Context;import android.content.res.TypedArray;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Rect;imp...
2022-02-18 10:59:14
1294
原创 hashmap转json并打印,hashmap转字符串
public class Student{ String age;//年龄 String name;//姓名 public Student(String age, String name) { this.age = age; this.name = name; } public String getAge() { return age; } public void setAge(String ag.
2021-05-08 11:41:45
1229
原创 windows通过cmd查看占用端口号,杀掉端口号占用得进程,根据进程PID杀掉进程,根据进程名称杀掉进程,根据进ID杀掉进程
第一步 查看所有端口号占用情况 输入netstat -ano 回车 如下图 我要找得是1080或者也可以查看指定端口号占用情况,输入netstat -ano|findstr "1080" //换成你要查询的端口如下图 进程PID是12420第二步 杀掉进程一、根据进程PID杀掉进程1、输入taskkill /F /PID 12420 //换成你自己得进程PID,如下图备注:由于进程重新启动后PID大概率会变,所以为了展示,重新启动后PID有12420变成了11868,...
2021-05-08 10:45:58
287
原创 ‘boolean androidx.fragment.app.FragmentManagerImpl.isDestroyed()‘ on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.fragment.app.FragmentManagerImpl.isDestroyed()' on a null object reference迁移AndroidX后,如果引用androidx.fragment版本低于1.1.0-alpha08(该版本没问题,再低一些的版本没测试,最好使用最新版本),则会崩溃。解决办法:1 如果
2020-11-18 11:27:34
1472
原创 Android开发TextvView实现镂空字体效果
记录一下...自定义TextViewpublic class HollowTextView extends AppCompatTextView { private Paint mTextPaint, mBackgroundPaint; private Bitmap mBackgroundBitmap,mTextBitmap; private Canvas mBackgroundCanvas,mTextCanvas; private RectF mBackgrou..
2020-10-28 13:26:32
1164
5
原创 AS 打包jar 报Cannot expand ZIP*******classes.jar as it does not exist
记录一下吧> Task :***********:copyJar FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':*********:copyJar'.> Cannot expand ZIP 'E:\*****\*****\*****\*****\*****\build\intermediates\bundles\release\classes
2020-07-21 11:12:54
843
原创 kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
一个是jre7一个是jdk当时对比了半天一直觉得没错,jre这个已经过时改成下面jdk7就行了,记录一下,去改下一个bug了将implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"改为implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"...
2020-07-06 14:49:33
538
原创 The SourceSet ‘instrumentTest‘ is not recognized by the Android Gradle Plugin
遇见nci这个错,今天要记录一下在app的build.gradle中将instrumentTest改成androidTest版本高于3.0貌似会报这个错
2020-07-02 14:51:32
223
原创 All flavors must now belong to a named flavor dimension
在app的build.gradle中添加flavorDimensions "default"
2020-07-02 14:48:40
217
原创 methodbooleanandroidxfragmentappFragmentManagerImplisDestroyed()onanullobjectreference
被这个问题困扰了好久,Androidx我要崩溃了,记录一下java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.fragment.app.FragmentManagerImpl.isDestroyed()' on a null object reference迁移AndroidX后,如果引用androidx.fragment版本低于1.1.0-alpha08(该版本没问题,再低一些的版本没
2020-05-20 13:35:10
605
原创 安卓开发下载apk下载文件代码
记录一下protected File downLoad(String httpUrl) { final String apkName = "down.apk"; File tmpFile = new File("/sdcard/update"); if (!tmpFile.exists()) { tmpFile.mkdir(); } final File file = new File("/sdca
2020-05-09 13:34:49
804
原创 Android开发安卓10不显示通知栏Notification不显示NotificationManager.notify无效通知栏不显示
Android8.0以上得加channelIdIntent intent = new Intent(SplashActivity.this,ChatActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0); ...
2020-04-23 13:10:27
6592
5
原创 Android开发长连接tcp/IP,soket通讯
附上demo连接:https://download.youkuaiyun.com/download/congcongguniang/12067740
2019-12-31 10:56:38
424
原创 Android开发ScrollView嵌套ViewPager,ViewPager嵌套RecyclerView根据RecyclerView动态设置ViewPager高度好看ViewPager指示器gif
视频效果xml代码<?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...
2019-12-31 09:18:40
934
原创 RecyclerView的使用RecyclerView怎么配置RecyclerView实现gridview
导入RecyclerView框架先在 build.gradle(Project:XXXX) 的 repositories 添加:allprojects { repositories { ... maven { url "https://jitpack.io" } } }然后在 build.gra...
2018-12-19 16:41:20
657
原创 Android开发PopupWindow的使用,PopupWindow 的基本使用,参数介绍,PopupWindow 如何显示
控件.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showPopupWindow(v); int[] location = new int[2]; v.getLocationOnScreen(locat...
2018-12-18 15:19:16
575
原创 Android开发TimePicker弹窗,如何默认显示当前时间的前一小时
Calendar c = Calendar.getInstance();int i = c.get(Calendar.HOUR_OF_DAY)-1;mTimePicker.setCurrentHour(i);
2018-09-26 14:17:20
1412
原创 Android开发月季年统计,月季年任意切换
很简单,就是繁杂,所以整理出来方便以后用 代码有点乱,哈哈哈,不影响使用工具类代码:package cn.statistic.cong.monthquarteryearstatisticdemo;import android.content.Intent;import android.os.Bundle;import android.support.ann...
2018-09-19 17:33:09
624
原创 安卓开发本地时间的两种获取方式
第一种:dateDate date = new Date(System.currentTimeMillis()); //系统当前时间SimpleDateFormat dateFormat = new SimpleDateFormat("'IMG'_yyyyMMdd_HHmmss");dateFormat.format(date); 第二种:Calendar...
2018-09-19 16:20:50
1020
原创 Android仿QQ消息拖拽黏连消失效果,气泡爆炸效果
公司需要这个效果,看了很多博客,根据自己项目的需要写出来的一个完整的过程. 拖拽控件代码根据手势拖动的位置利用贝塞尔曲线算法画出控件package cn.stike.bubble.stickbubbledemo.view;import android.content.Context;import android.graphics.PixelFormat;...
2018-09-19 15:05:38
1159
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅