![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android
「已注销」
这个作者很懒,什么都没留下…
展开
-
RecyclerView显示不全
安卓6.0以上ScrollView嵌套RecyclerView条目无法全部显示一般情况下,应当避免ScrollView嵌套RecyclerView, 但有时候就需进行嵌套, 以前嵌套listView会导致条目显示不完整, 如果嵌套RecyclerView在6.0以下系统, 初了滑动不太流畅外其他功能全部正常, recyclerView.setNestedScrollingEnabled(false) 可以解决滑动不流畅. <RelativeLayout原创 2021-11-15 16:19:51 · 3223 阅读 · 0 评论 -
Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes?
有一个这样的错误, 没有见过, 后来在StackOverflow看到了一样的报错,找到了解决方法;报错信息(androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:28.0.0)Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.cor原创 2021-11-02 13:03:55 · 11261 阅读 · 6 评论 -
Android studio中关于真机调试时远程主机强迫关闭了一个现有连接的解决方法
最近在用Android studio连接手机进行调试时老是出现远程主机强迫关闭了一个现有连接,如下图所示。在网上找了一些解决方法但都不是很详细,下面记录一下我的解决方法。查找资料发现应该是adb.exe的端口被占用了。可以先试试用adb kill-server和adb start-server试试能不能解决,如果不能解决,在试试一下方法。1、开始-运行-cmd打开终端窗口。输入 netstat -aon|findstr "5037" 查看5037端口都有哪些进程,如下图:然后在根据其P.原创 2021-11-01 14:33:43 · 3598 阅读 · 0 评论 -
解决AndroidStudio 模拟器无网络连接
打开cmd,进入你电脑上skd的安装目录下的emulator文件夹。如果不想那么麻烦在命令行手动输入路径,可以先进入到emulator文件夹,然后在地址栏输入cmd,打开之后就自动进入到当前文件夹中了。(win7可以,其他版本的系统不知道行不行)然后再命令行输入如下命令: (Nexus_5X_API_27_x86替换成你自己的模拟器名字,其他不变)emulator -avd Nexus_5X_API_27_x86 -dns-server 8.8.8.8,114.114.114.114.原创 2021-10-28 13:17:15 · 1301 阅读 · 0 评论 -
Android Studio之连接模拟器
Android开发需要进行预览调试,一般有两种方法,一种是真机调试,一种就是使用模拟器,但是Android Studio自带的模拟器实在是难用。打开AS中的Terminal输入:adb connect 127.0.0.1:7555显示 connected to 127.0.0.1:7555,表示连接成功附:夜神模拟器:adb connect 127.0.0.1:62001逍遥安卓模拟器:adb connect 127.0.0.1:21503天天模拟器:adb connect 1.原创 2021-10-26 14:51:57 · 807 阅读 · 0 评论 -
升级ndk报错:No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
方法:重定向目录在一篇文章中发现可以下载原ndk版本将原 tool-chainsmips64el-linux-android复制进ndk 的toolchains目录。创建软连接:将mips64el-linux-android指向aarch64-linux-android-4.9注意其中aarch64-linux-android-4.9是 当前已有目录。在windows cmd 执行:mklink /j mips64el-linux-android aarch64-lin...原创 2021-10-26 14:46:15 · 896 阅读 · 0 评论 -
AS运行main()方法报错:SourceSet with name ‘main’ not found
记录一下在AS上运行Java文件的main()方法时报错,报错如下:解决方法:在.idea文件夹下的gradle.xml文件中添加<option name="delegatedBuild" value="false" />,然后重新运行就可以了原创 2021-10-22 15:37:02 · 194 阅读 · 0 评论 -
WebView 加载微信公众号文章加载失败或图片不显示
解决给webview加上如下配置:WebSettings settings = webview.getSettings(); if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); settings.setJavaScriptEnabled(true);//启用js原创 2021-10-22 13:50:52 · 2286 阅读 · 0 评论 -
Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit va
Android Studio启动app时报错:Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/原创 2021-10-22 13:44:28 · 159 阅读 · 0 评论 -
Duplicate class android.support.v4.app and support-compat-25.3.1-runtime.jar
AS运行出现如下错误:Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.0.1-runtime.jar (androidx.core:core:1.0.1) and support-compat-25.3.1-runtime.jar (com.android.support:support-compat:25.3.1)Duplicate class android.suppo原创 2021-10-21 16:00:02 · 182 阅读 · 0 评论 -
android 网络报错 java.lang.SecurityException: Permission denied (missing INTERNET permission?) 解决
Android app里试图用HttpUrlConnection获取网络连接,忘记在AndroidManifest清单文件里声明需要用到Internet的权限,运行时报此错误。解决方法在AndroidManifest.xml中 与Application平级的地方加入<uses-permission android:name="android.permission.INTERNET"/>...原创 2021-10-20 12:33:42 · 811 阅读 · 0 评论 -
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
Session 'app': Installation did not succeed. The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED出现这种异常,一般就是AndroidManifest.xml存在格式问题了,检查一下包名、类名等格式是否正确。...原创 2021-10-15 10:48:25 · 597 阅读 · 0 评论 -
‘api.Result.getData()‘ on a null object reference
public interface PostRoute { @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头 @POST("api/FlyRoute/Add") Call<FlyRouteBean postFlyRoute(@Body RequestBody route);//传入的参数为RequestBody }原创 2021-09-22 13:11:34 · 317 阅读 · 0 评论 -
解决java.lang.RuntimeException: Can‘t toast on a thread that has not called Looper.prepare()
Looper用于封装了android线程中的消息循环,默认情况下一个线程是不存在消息循环(message loop)的,需要调用Looper.prepare()来给线程创建一个消息循环,调用Looper.loop()来使消息循环起作用,使用Looper.prepare()和Looper.loop()创建了消息队列就可以让消息处理在该线程中完成。(摘自网上大神的解释) 所以咱需要在子线程中手动创建一个Looper,也就是解决方案:Looper.prepare();mToas...原创 2021-09-16 13:15:04 · 929 阅读 · 0 评论 -
新版3.6.1 Android Studio 解决AndroidStudio编译出现available for offline mode的问题
旧版解决新版解决原创 2021-09-15 16:46:49 · 607 阅读 · 1 评论 -
AndroidStudio模拟机卡在“waiting for debugger“界面
1.当你使用AS进行调试时,发现卡在进入调试模式的waiting for debugger 不动了,出现这种问题是adb端口被抢占了。解决方法就是:找到除了,adb.exe以及Android Studio的PID之外,其他占用该端口的PID进程都要关闭。在命令行:netstat -ano|findstr "5037"C:\Users\Ryan>netstat -ano|findstr "5037" TCP 127.0.0.1:5037 0.0.0.0:...原创 2021-08-14 08:04:30 · 977 阅读 · 1 评论