- 博客(79)
- 收藏
- 关注
原创 springboot-打包war部署tomcat
1.然后将其war包JavaWebTest.war复制粘贴到apache-tomcat-8.5\webapps\目录下(个人习惯,另外的目录理应也可以)springboot 入口文件继承SpringBootServletInitializer类重写configure设置tomcat访问入口。2、配置apache-tomcat-8.5\conf\server.xml文件。3.访问路径:http://localhost:8080/car/设置打包类型和打包名称。
2023-03-17 10:24:31
421
原创 Intent Action_dial 在 android 11 中不起作用
intent Acation_dial 在Android 11中不起作用
2022-10-19 14:30:27
1062
原创 Android WebView 加载富文本
String introduce=data webView.getSettings().setBuiltInZoomControls(true) webView.setWebViewClient(WebViewClient()) webView.loadDataWithBaseURL(null, introduce, "text/html", "utf-8", null)
2021-12-02 09:40:33
2978
原创 Android 异常记录:java.lang.AbstractMethodError;视频exoplayer2打包运行时闪退
前言:我的时flutter集成到Android原生项目中去 , flutter 中播放视频使用video_player,Android依赖插件com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer,真机运行时能正常使用播放,但在打包发版的使用遇到在播放视频的时候出现闪退问题,由于是在打包运行看不到日志这边只能等到第二天查看bugly日志,错误信息如下:java.lang.AbstractMethodError: abstract method void com.
2021-08-27 09:20:32
1628
原创 Android原生项目集成Flutter项目混合开发
按照官方文档的集成方式有2种,一种的aar的打包集成方式,一种是引入model的形式,这里主要说下aar打包的方式我遇到的问题,按照官方提供的打包方式我打包下来是没有flutter依赖的第三方插件,百度和谷歌看来下,如果flutter集成了第三方插件的话 需要使用fat-aar插件来打包aarfat-aar官方文档: https://github.com/kezong/fat-aar-androidflutter官方文档:https://flutter.dev/docs/development/.
2021-07-28 16:35:28
788
原创 Android Mob ShareSDK分享遇到的坑
一键分享主要注意的就是 public void shareMsg(String name,String title,String url) { Bitmap logo = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher); OnekeyShare oks = new OnekeyShare(); //隐藏QQ平台// oks.addHiddenP.
2020-08-20 09:57:15
1599
转载 Android 工程V4包找不到的问题
最新升级的Android Studio 后,导入新的第三方库,发现没有 V4的Fragment,检查项Mode的Gradle 发现com.android.support:appcompat-v7没有问题,后来发现一些默认的第三方依赖由原来的androd.变成了androidx*后来百度了下androidx ,它是官方升级让我们默认要去自动去引用的,它和原来的android的区别是做了不同版本的兼容,比如我们项目不同的Mode分别引用的implementation A-1.0库 implement
2020-08-19 14:45:45
789
转载 Android设置activity横屏
Android设置activity横屏首先说明,设置横屏只能对于activity设置,要想对整个application有效的话,就在每个activity中都设置上横屏吧。设置横屏方法有二:一、Manifest文件中设置在activity中加入标签android:screenOrientation="landscape" android:screenOrientation="sensorLandscape"landscape可设置该activity强制横屏,只有一个方向,不会根据手
2020-08-08 11:49:53
8319
1
原创 Android APP跳转微信小程序和APP跳转支付宝小程序传参
Android APP跳转微信小程序微信开放文档链接MINIPROGRAM_TYPE_PREVIEW:体验版.MINIPROGRAM_TYPE_TEST:开发版MINIPTOGRAM_TYPE_RELEASE:正式版String appId = "wxd930ea5d5a258f4f"; // 填应用AppIdIWXAPI api = WXAPIFactory.createWXAPI(context, appId);WXLaunchMiniProgram.Req req = new WX
2020-08-06 17:14:48
6461
原创 android 解决BaseQuickAdapter中EditText输入错位问题
android 解决BaseQuickAdapter中EditText输入错位问题事情是这样遇到的 在Adapter先在EditText中输入之后进行刷新之后数据开始出现错位和复用的现象,搞了一上午,还以为是那个细节出错了,之后看到相关资料之后,原来是recyclerView出现了复用的现象,再Adapter中的convert()方法中调用 helper.setIsRecyclable(false);禁止复用就可以了 @Override protected void convert(
2020-08-04 17:33:52
867
转载 Android 8.0 启动后台service 出错 IllegalStateException: Not allowed to start service Intent
Android 8.0 启动后台service 出错 IllegalStateException: Not allowed to start service IntentAndroid 8.0 不再允许后台service直接通过startService方式去启动, 具体行为变更如下:如果针对 Android 8.0 的应用尝试在不允许其创建后台服务的情况下使用 startService() 函数,则该函数将引发一个 IllegalStateException。 新的 Context.startFo
2020-07-21 15:12:42
432
转载 安卓9.0 Cleartext HTTP traffic to XXX not permitted问题
安卓9.0 Cleartext HTTP traffic to XXX not permitted问题使用HttpUrlConnection 会报这个问题Cleartext HTTP traffic to XXX not permitted使用OKHttp会报这个问题CLEARTEXT communication ** not permitted by network security policy简单介绍原因:为保证用户数据和设备的安全,Google针对下一代 Android 系统(An
2020-07-21 11:39:54
239
原创 andorid 在列表Adapter中edittext使用TextWatcher导致数据错乱问题
andorid 在列表Adapter中edittext使用TextWatcher导致数据错乱问题这里使用的是RecyclerView使用BaseQuickAdapterEditText et_money=helper.getView(R.id.et_money); if (et_money.getTag() instanceof TextWatcher){ et_money.removeTextChangedListener((TextWatcher) et_money.g
2020-07-04 17:38:13
904
原创 Android EditText软键盘弹出时防止布局上移和关闭软键盘
EditText软键盘弹出时防止布局上移在代码setContentView()之前加入:this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);...
2020-04-29 11:54:30
1774
转载 Android系统服务及权限设置
Android系统服务及权限设置原文 :http://blog.sina.com.cn/s/blog_66edd39d01012i46.html1 活动管理器权限 <uses-permission android:name="android.permission.GET_TASKS"/>代码 ActivityManager activityManager = (Activi...
2020-04-28 11:07:59
1333
原创 android设置状态栏颜色
android设置状态栏颜色在BaseActivity中设置 setWindowStatusBarColor(this, R.color.transparent,true); public void setWindowStatusBarColor(Activity activity, int colorResId,boolean dark) { try { ...
2020-04-27 10:01:52
541
转载 android 获取设备唯一ID
android 获取设备唯一ID/** * 获取设备唯一ID * @return */ @SuppressLint("MissingPermission") public static String getUUID() { String serial = null; String m_szDevIDShort = "35" + Build.BOARD.leng...
2020-04-25 13:43:36
2584
转载 java.net.UnknownServiceException: CLEARTEXT...
背景: 还是在调用远程接口,进行网络通信的时候,报了如下错误:W/System.err: java.net.UnknownServiceException: CLEARTEXTcommunication to xxx.xxx.xxx not permitted by network security policy原因:为保证用户数据和设备的安全,Google针对下一代 Android...
2020-04-15 09:29:33
269
原创 androidx 10.0 获取图片失败:报错open failed: EACCES
报错open failed: EACCES:绕了一大圈,刚开始以为是权限问题,但是我全是加了,6.0以上的权限也加了还是报错open failed: EACCES,百度找了一遍 全是说要手动添加权限的…这里做下记录需要在 AndroidManifest.xml 中加入 android:requestLegacyExternalStorage=“true”<application ...
2020-04-10 14:25:50
1499
2
原创 android EdItText保留两位小数
private TextWatcher etNumTextWatcher = new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void beforeTextChanged(Char...
2020-04-02 21:30:57
686
原创 Android 7.0以上 适配安装APK
Android 10 适配安装APKprivate static void install(Context context, File file) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (Buil...
2020-04-01 14:26:55
2467
原创 Android WeakDataHolder保存数据
弱引用方式保存数据,防止内存泄漏import java.lang.ref.WeakReference;import java.util.HashMap;import java.util.Map;public class WeakDataHolder { private static WeakDataHolder instance; public static W...
2019-11-29 16:15:17
287
转载 Android 时间选择器 PickerView
Android 时间选择器 PickerViewhttps://github.com/Bigkoo/Android-PickerView
2019-11-18 15:28:01
275
原创 android 更换皮肤
1.我们在Values文件中创建attr.xml文件,在其中创建自己的需要的自定义属性,这里是我需要更改的颜色属性 <resources> <attr name="theme_bg_color" format="reference" /> <attr name="selector_img" format="reference"/>...
2019-11-12 16:00:04
246
转载 android 获取屏幕宽高
private void getScreenSize() { //1、通过WindowManager获取 WindowManager manager = this.getWindowManager(); DisplayMetrics outMetrics = new DisplayMetrics(); manager.getDefa...
2019-11-08 17:45:08
153
原创 android studio引用module出的错:ERROR: Unable to resolve dependency for ':app@debug/compileClasspath'
解决方案1模块的support版本高于主项目的support版本把其他模块的support版本改为一致即可解决方案2引用的moduleapply plugin: ‘com.android.library’//这里引用的是library,而不是application//这里注意还要把applicationId删除掉apply plugin: 'com.android.libr...
2019-11-08 13:45:22
406
转载 android WarpLinearLayout自动换行
这是之前在网上看到的链接地址https://www.jb51.net/article/146270.htm 这里只为记录在attr.xml中创建自定义View属性 <!--自动换行的LinearLayout !--> <declare-styleable name="WarpLinearLayout"> <attr name="g...
2019-11-08 09:06:17
1052
原创 Android 设置字体样式
Android 设置字体样式1.首先下载字体样式 我是在这里下载的字体样式http://www.zitixiazai.org/2.然后在下载好的字体样式放到assets项目文件下接下来就是代码的使用了 直接贴图 <TextView android:layout_width="wrap_content" android:layout_heigh...
2019-10-23 09:40:57
5764
原创 android中复制粘贴文本
android中复制粘贴文本及跳转微信将文本内容放置系统剪贴板中 // TODO: 2019/6/17 String s = "123456"; //获取剪贴板管理器: ClipboardManager cm = (ClipboardManager) getSystemService(Con...
2019-10-21 16:30:20
378
原创 android ShareSDK集成第三方登录和分享
android ShareSDK集成第三方登录和分享在MobTech中注册账号,进入开发者平台中添加应用获取自己的AppKey和App Secret在线引用配置文件在根模块build.gradle中添加buildscript { repositories { google() jcenter() } depende...
2019-10-12 16:37:36
765
原创 android 7.0系统解决拍照的问题
android 7.0系统解决拍照的问题android.os.FileUriExposedException: file:///storage/emulated/0/textphoto.jpg exposed beyond app through ClipData.Item.getUri()在oncreate()方法中添加一下代码 StrictMode.VmPolicy.Bui...
2019-09-27 14:44:04
247
原创 android AlertDialog修改butto颜色
AlertDialog修改butto颜色 AlertDialog dialog=new AlertDialog.Builder(this, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT) .setTitle("提示") .setMessage(...
2019-09-19 15:17:58
279
原创 android 中ListView、RecyclerView自动跳到页面顶部或者中间的问题
ListView、RecyclerView自动跳到页面顶部或者中间的问题解决问题:在父控件中添加android:descendantFocusability="blocksDescendants"这一句属性
2019-08-29 14:35:35
709
2
原创 java 中文名和少数民族的名字 常用正则表达式
中文名和少数民族的名字 /** * 验证输入的名字是否为“中文”或者是否包含“·” */ public static boolean isLegalName(String name){ if (name.contains("·") || name.contains("•")){ if (name.matches("^[\\u...
2019-08-19 09:42:22
1903
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人