草庐IT

android - java.net.ConnectException : Connection refused: connect Error while Installing APK 异常

我在运行时在android中遇到错误。这是java.net.ConnectException:Connectionrefused:connectErrorwhileInstallingAPK.请有人帮我看看发生了什么以及如何解决。日志中显示的错误是。Connectionattempts:109:43:16'C:\Users\Android\sdk\platform-tools\adb.exe,start-server'failed--runmanuallyifnecessary运行控制台显示错误java.net.ConnectException:Connectionrefused:co

android - 读取失败 : EBADF (Bad file descriptor) while reading from InputStream Nougat

随着androidN最近的变化,我不得不升级我的代码以使用FileProvider来使用相机/文件管理器获取图像/文件。代码在模拟器(genymotion)中运行良好,但在MotoG4plus中抛出IO异常。if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N){try{ParcelFileDescriptorfcd=getContentResolver().openFileDescriptor(uriOrig,"r");//uriOrigistheurireturnedfromcameraif(fcd!=null){InputStreamin

java - FileNotFoundException 打开失败 : ENOENT (No such file or directory) while upload any type of file by Samsung devices

我想通过从文件管理器中选择文件来将文件上传到服务器所以我使用此代码单击按钮打开了文件管理器,button_upload_attachment.setOnClickListener(newView.OnClickListener(){@OverridepublicvoidonClick(Viewv){String[]galleryPermissions={android.Manifest.permission.READ_EXTERNAL_STORAGE,android.Manifest.permission.WRITE_EXTERNAL_STORAGE};if(EasyPermissio

android - java.lang.RuntimeException : An error occured while executing doInBackground() 错误

我正在使用下面的代码。它在AndroidStudio中出错。你能帮忙吗?根据我的理解,args[0]没有填充某些值。这是为什么?如果args[0]没有为此选择任何其他实现的任何值。importandroid.app.Activity;importandroid.content.Intent;importandroid.os.AsyncTask;importandroid.os.Bundle;importandroid.provider.DocumentsContract;importandroid.renderscript.Element;importandroid.util.Log;

android - com.android.builder.dexing.DexArchiveBuilderException : Error while dexing

我在尝试运行我的项目时遇到了这个问题-com.android.builder.dexing.DexArchiveBuilderException:Failedtoprocess.gradle\caches\transforms-1\files-1.1\firebase-analytics-impl-11.8.0.aar\0e3311be69809df8820438f9666651f5\jars\classes.jarcom.android.builder.dexing.DexArchiveBuilderException:Errorwhiledexing.com.android.too

android - 如何解决致命异常java.lang.RuntimeException : An error occured while executing doInBackground()

我正在开发与聊天相关的类似应用程序我正在使用后台同步类有时会出现强制关闭我正在使用.netwebservices后台我正在接收更新到ui的消息和图像后台下载过程错误是:05-1705:24:17.925:ERROR/AndroidRuntime(1618):FATALEXCEPTION:AsyncTask#105-1705:24:17.925:ERROR/AndroidRuntime(1618):java.lang.RuntimeException:AnerroroccuredwhileexecutingdoInBackground()05-1705:24:17.925:ERROR/A

android - 适用于 Android 的 Google map v2 : Cannot remove marker while map is being rendered

我有一个fragment:GoogleMapv2fragment用于添加标记(用户的位置)的“位置”按钮“删除位置”按钮(删除用户生成的标记)其他标记(例如一般兴趣点)自定义图block叠加层当用户点击“放置”按钮时,应用程序会存储一个包含标记引用的HashMap,并将对象放置在WeakHashMap中。当用户点击“删除地点”时,应用程序会遍历调用marker.remove()的map键。本地图完全渲染时,标记会被正确移除,但是,如果在渲染map时按下按钮,则标记不会被移除。有人遇到过同样的问题吗?如何解决?我不能使用map.clear(),因为它会删除所有标记、折线、叠加层等。我只想

android - 错误 :Execution failed for task ':app:dexDebug' error in my project while I added new dependency

我没有在我的项目中添加任何库/jar(在libs中)只有这个依赖项。我的build.gradle文件。android{compileSdkVersion23buildToolsVersion"23.0.1"defaultConfig{applicationId"com.android.example23"minSdkVersion14targetSdkVersion23versionCode1versionName"1.0"}buildTypes{release{minifyEnabledfalseproguardFilesgetDefaultProguardFile('proguar

android - DatabaseException : Expected a Map while deserializing, 但得到了一个类 java.lang.Long

此问题/错误的根本原因是什么?如何解决?我的数据模型结构不正确吗?或者我做错了查询?//添加新评论Stringcomment=medit.getText().toString();CommentnewComment=newComment(user,comment,postKey);db.child("Post-Comments").child(postKey).push().setValue(newComment);//检索帖子中的所有评论//使用FirebaseRecyclerView和fragmentDatabaseReferencemRef=db.child("Post-Comm

android - 视频 View : how to always show MediaController while playing video

我有一个非常简单的任务-只是在VideoView上播放视频时显示播放控件。但我无法解决它。这是我用于初始化VideoView和设置MediaController的一段代码:videoView.setVideoURI(Uri.parse(videoUrl));MediaControllermediaController=newMediaController(this);videoView.setMediaController(mediaController);videoView.setKeepScreenOn(true);videoView.setOnPreparedListener(m