草庐IT

while-read

全部标签

android - AdvertisingIdClient : Error while reading from SharedPreferences java. lang.SecurityException:不再支持 MODE_WORLD_READABLE

我想在我的项目中集成AdjustSDK,但出现此错误AdvertisingIdClient:从SharedPreferences读取时出错java.lang.SecurityException:不再支持MODE_WORLD_READABLE但我没有在任何地方使用MODE_WORLD_READABLE这里是我的代码StringappToken=getString(R.string.adjust_token);Stringenvironment=AdjustConfig.ENVIRONMENT_PRODUCTION;AdjustConfigconfig=newAdjustConfig(th

android - kotlin 控制流 "while"错误

这个问题在这里已经有了答案:Assignmentsarenotexpressions-Kotlin(2个答案)关闭4年前。我在JAVA中有以下代码:byte[]data=newbyte[1024];intcount;inttotal=0;while((count=input.read(data))!=-1){output.write(data,0,count);total+=count;publishProgress((int)(total*100/sizeFichero));}我正在将我的应用程序更新到Kotlin,但在此期间,我遇到了错误。在这段代码中,我得到以下错误:Assign

java - Dagger 2 : error while getting a multiple instances of same object with @Named

我怎样才能得到像游标一样返回类型相同的多个实例例如:-Module@CursorScopepublicclassCursorModule{@ProvidesCursorprovideSongCursor(@Named("Song")Musicianmusician){returnmusician.getApplicationContext().getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,newString[]{BaseColumns._ID,MediaStore.Audio.AudioCo

android - 异常 java.lang.SecurityException : reading . .MediaDocumentsProvider ... 需要 android.permission.MANAGE_DOCUMENTS,或 grantUriPermission()

我在尝试为个人资料图片选择图片时仅在某些设备中发现了此问题。在模拟器中检查时没有看到这些问题,但在应用程序的实时版本中,此用户面临这些问题。从firebase崩溃报告中截取的屏幕截图。请帮助我找出问题所在。AndroidMenifest.xml......SomeActivity.javaprivatevoidpickProfilePictureTask(){Intentintent=null;if(Build.VERSION.SDK_INT>19){intent=newIntent(Intent.ACTION_OPEN_DOCUMENT,android.provider.MediaS

android - 权限拒绝 : reading com. android.providers.downloads.DownloadStorageProvider 需要 android.permission.MANAGE_DOCUMENTS

编辑:这不是一个重复的问题。毫无疑问,当您无法控制发送Intent的Activity时,我已经看到了如何解决这个问题的答案(在我的例子中,浏览器应用程序或文件浏览应用程序正在向我的应用程序发送Intent)。更具体地说,这不是处理照片/图库。这一直困扰着我的一个应用程序。我个人无法在任何设备上让它发生,但我可以从崩溃中看到它经常发生在其他人身上。我的应用程序从外部应用程序接收到包含ZIP文件的Intent。我在onCreate()或onNewIntent()中捕获它:Intentintent=getIntent();if(intent!=null&&intent.getData()!=

java - Android 可打包 : How to read/write string array lists and integer arrays

我在尝试将字符串数组列表和整数数组写入包裹时遇到问题。这是我的类字段StringuniqueDate;ArrayListset1Numbers;ArrayListset2Numbers;ArrayListUIDs;int[]selectedStatus;这部分是将数据写入parcelpublicvoidwriteToParcel(Parceldest,intflags){dest.writeString(uniqueDate);dest.writeStringList(set1Numbers);dest.writeStringList(set2Numbers);dest.writeSt

java - 蓝牙传输应用程序在使用 InputStream.read() 后停止,没有错误

我正在尝试使用这些来源使文件传输蓝牙应用工作:http://developer.android.com/guide/topics/connectivity/bluetooth.htmlhttps://android.googlesource.com/platform/development/+/25b6aed7b2e01ce7bdc0dfa1a79eaf009ad178fe/samples/BluetoothChat/当我尝试以这种方式使用InputStream.read()方法获取InputStream字节时:publicclassConnectedThreadextendsThre

1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and bin

项目场景:在MySQL中创建函数报错问题描述1418-ThisfunctionhasnoneofDETERMINISTIC,NOSQL,orREADSSQLDATAinitsdeclarationandbinaryloggingisenabled(youmightwanttousethelesssafelog_bin_trust_function_creatorsvariable)`createfunctionaab()returnsintbeginreturn1+1;end;原因分析:原因是开启了log-bin日志,创建函数时,函数中没有包含DETERMINISTIC,NOSQL和READS

android - Eclipse ADT 插件 : An error occurred while collecting items to be installed

Anerroroccurredwhilecollectingitemstobeinstalledsessioncontextwas:(profile=SDKProfile,phase=org.eclipse.equinox.internal.p2.engine.phases.Collect,operand=,action=).Unabletoreadrepositoryathttps://dl-ssl.google.com/android/eclipse/plugins/com.android.ide.eclipse.adt_18.0.0.v201203301601-306762.ja

android ExceptionInInitializerError Caused by Unable to determine record types while new HSSFWorkbook(inputStream) 问题

获取错误E/AndroidRuntime:FATALEXCEPTION:AsyncTask#1java.lang.RuntimeException:AnerroroccuredwhileexecutingdoInBackground()atandroid.os.AsyncTask$3.done(AsyncTask.java:299)atjava.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)atjava.util.concurrent.FutureTask.setException(FutureTask.