草庐IT

FIELD_ICON_SIZE

全部标签

android - 游标索引越界 "index 0 requested: with size 0"

当我在数据库中搜索某些内容时,出现游标索引越界“请求索引0:大小为0”错误。我在我的数据库中搜索的项目目前不存在,我知道这一点,但我如何处理该项目不存在的查询。我发送一个电话号码publicStringsearchNumber(Contextcontext,Stringnumber){ContactDBdb=newContactDB(context);db.open();Cursorcurs=db.getIdFromPhone(number);Stringtest=curs.getString(curs.getColumnIndex(db.PHONE_NUMBER));//failsh

android - 无法创建 xml(布局)文件中的新 View (java.lang.NoSuchFieldError : No static field tv of type I)

我有一个使用两个模块(库)的项目,我在我的一个库中创建了一些Activity及其各自的布局文件,我似乎无法在该布局中添加新View(Textview、Imageview等)。这是logcat输出。java.lang.NoSuchFieldError:NostaticfieldtvoftypeIinclassLcom/camera/sushant/opencamera/R$id;oritssuperclasses(declarationof'com.camera.sushant.opencamera.R$id'appearsin/data/app/com.streetspotr.stre

android - 创建快捷方式 : how can I work with a drawable as Icon?

下面是我的代码,用于创建所选应用程序的快捷方式。我真的没问题,应用程序运行良好。问题是我能够使用我的应用程序的资源创建快捷方式:intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,Intent.ShortcutIconResource.fromContext(this,R.drawable.icon));但我真的很想要自定义可绘制对象。(DrawablemyDrawable=.......)我该怎么办?ResolveInfolaunchable=adapter.getItem(position);finalIntentshortcut

ElasticSearch script查询报错A document doesn‘t have a value for a field! Use doc[<field>].size()==0

ES版本7.6.0想筛选某两个字段之和大于10的文档,需要用到脚本,简化的请求如下{"query":{"bool":{"must":[{"script":{"script":"doc['field'].value>=1"}}]}}}报非法状态异常,其实报错提示大概也讲清楚了,“Adocumentdoesn’thaveavalueforafield!”(有一个文档的字段没有值),不过总觉得指示清楚哪个文档哪个字段不是更友好么;并且也给出了解决方案:用doc[].size()==0检查文档是否缺失字段{"error":{"root_cause":[{"type":"script_exception

android - "at least one ID field (installationId,deviceToken) must be specified in this operation"解析

这很简单,当您第一次在手机上使用parse时,它​​就像一个魅力。当您重新安装您的应用程序时,它会搞砸一切。如stackoverflow所述通过Eran:“PushService.subscribe似乎将订阅缓存在本地存储中,以避免在您多次启动应用程序时重新订阅。这是该方法的第一个参数的用途:context-这用于访问本地存储以缓存订阅,因此它当前必须是一个可行的上下文。(引自here)。但是,当您卸载该应用程序时,该应用程序的本地存储将从您的设备中删除,因此新安装将导致PushService.subscribe重新注册到Google云消息传递。如果新注册返回一个新的注册ID,Pars

安卓 : change the position of alert dialog icon

我在androidxml文件中有一个警告对话框。我的警告对话框的左侧有一个图标。我想将图标的位置更改为右侧。我不想也使用自定义对话框像这样: 最佳答案 要将警报对话框的布局方向设置为RTL,您可以使用OnShowListener方法。设置title,message,....使用这个方法。dialog=alertdialogbuilder.create();dialog.setOnShowListener(newDialogInterface.OnShowListener(){@OverridepublicvoidonShow(Dia

android - 无效路径错误 : get the external memory size

当我调用它来获取外部内存详细信息时,出现如下错误。05-0716:55:07.710:E/AndroidRuntime(22624):FATALEXCEPTION:mainjava.lang.IllegalArgumentException:Invalidpath:/storage/emulated/005-0716:55:07.710:E/AndroidRuntime(22624):atandroid.os.StatFs.doStat(StatFs.java:46)05-0716:55:07.710:E/AndroidRuntime(22624):atandroid.os.StatF

java - 使用 byte[] 抑制 Android Unread Field 警告

我在AndroidStudio中使用java.lang.SuppressWarnings包。我无法摆脱这个:EI_EXPOSE_REP2:Mayexposeinternalrepresentationbyincorporatingreferencetomutableobject(findbugstask)这是通过setter方法发生的。如何摆脱这个警告?publicclassPropertyDetailDocumentStorageModelimplementsParcelable{@SerializedName("picture")privatebyte[]mPicture;publ

android - 构建Android项目时"trouble writing output: Too many field references: 70185; max is 65536. You may try using --multi-dex option."

我遇到了这个错误,但没有发现错误消息,所以我想我应该分享我想出的解决方案,以免遇到问题的其他人重复我的工作。在编写用于(大型)应用程序的新Android库(apklib)时,当我将新项目添加为依赖项时,在dexing期间出现以下错误:troublewritingoutput:Toomanyfieldreferences:70185;maxis65536.Youmaytryusing--multi-dexoption.Referencesbypackage:它失败的特定构建步骤是:java-jar$ANDROID_SDK/build-tools/19.0.3/lib/dx.jar--de

成功解决 ImportError: cannot import name ‘Field‘ from ‘torchtext.data‘

待解决问题importdatetimeimporttimefromtorchtext.dataimportField,Dataset,Example,Iteratorimportcopyimporttorch.nnasnn当试图导入以上包的时候,出现了报错13importdatetime14importtime--->15fromtorchtext.dataimportField,Dataset,Example,Iterator16importcopy17importtorch.nnasnnImportError:cannotimportname'Field'from'torchtext.da