草庐IT

providing-resources

全部标签

android - WARN in logcat ResourceType : For resource . .., entry index(...) is beyond type entryCount(1)

每次应用程序呈现某些布局时,我都会在logcat上收到这些警告。试图搜索但找不到线索。我认为与资源(可绘制对象、字符串或值)有关,但我不知道是什么原因造成的。这不是错误,但有点烦人。有人有想法吗?04-2215:28:33.20421943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxxW/ResourceType﹕Forresource0x01030128,entryindex(296)isbeyondtypeentryCount(1)04-2215:28:33.20421943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxxW/ResourceT

android - 使用 Google API 进行后台位置更新 - Fused Location Provider 不准确

我一直在使用GoogleApiClient进行后台位置更新并进行测试,以进行基于间隔和位移的更新。经过几天的测试和分析,我发现了一些出乎我意料的输出变化。在使用setInterval和setFastestInterval进行基于间隔的更新时,假设我已将Interval设置为15分钟和最快间隔为10分钟,90%的时间我在预期的间隔(10到15分钟)内获得更新。但有时我注意到更新花费的时间比指定的间隔长得多,例如,差异大约是30分钟和60分钟。知道为什么会有差异吗?在使用setMinimumDisplacement进行基于距离的更新时,假设我已将Displacement设置为200米,我只

android - 未找到输出 : error: resource style/TextAppearance. Compat.Notification.Info(又名 package_name :style/TextAppearance. Compat.Notification.Info)

切换到AndroidStudio3.2canary后,我收到以下构建错误。我看过this发布这个人有类似问题但没有提到解决方案的地方。我想尝试新的Material组件和喷气背包,所以有没有可能我不必切换回去。com.android.builder.internal.aapt.v2.Aapt2Exception:AndroidresourcelinkingfailedOutput:error:resourcestyle/TextAppearance.Compat.Notification.Info(akacom.nsnik.nrs.kotlintest.debug:style/TextA

ic_sync_black_24dp.xml 的 android.content.res.Resources$NotFoundException

我已经为此苦苦挣扎了一个多星期,因为我认为它必须与我的环境有关,但我无法缩小范围。我开始一个空项目,添加一个“空白”Activity并接受所有默认设置。项目设置完成后,我添加一个“设置”Activity。在MainActivity.java中,我添加了两行代码来连接两个Activity,然后构建项目。publicbooleanonOptionsItemSelected(MenuItemitem){//Handleactionbaritemclickshere.Theactionbarwill//automaticallyhandleclicksontheHome/Upbutton,so

android - 新的 Android Gradle 构建系统构建配置包名称与 Provider Authority 冲突

我已经更新我的项目以使用新的基于Gradle的构建系统,这主要是因为我有点恼火,因为我使用该设备进行开发,所以我无法在我的设备上安装我的应用程序来使用它。我在新构建系统的packageNameSuffix产品中看到了很多希望。我遇到的问题涉及list中包名称以外的问题。还有其他部分必须是唯一的,包括权限(专门针对GCM)和ContentProviderAuthorities。当尝试使用.debug后缀安装时,我收到错误消息,指出该包的GCM权限尚未定义,并且我正在尝试安装重复的提供程序。是否可以在我的list中放置一个变量来代替这些字符串,以便构建系统也能适本地替换它们?

android - 没有 @Provides-annotated 方法就不能提供上下文,但它是吗?

我有以下简单模块:@ModulepublicclassApplicationModule{privateCustomApplicationcustomApplication;publicApplicationModule(CustomApplicationcustomApplication){this.customApplication=customApplication;}@Provides@SingletonCustomApplicationprovideCustomApplication(){returnthis.customApplication;}@Provides@Sing

以编程方式设置 android.R.attr.listChoiceIndicatorMultiple 时的 android.content.res.Resources$NotFoundException

我正在尝试以编程方式为ListView中的CheckedTextView项目设置“android:checkMark”属性。运行我的应用程序时出现以下异常:android.content.res.Resources$NotFoundException:ResourceID#0x101021aID#0x101021a的资源对应于android.R.attr.listChoiceIndicatorMultiple,这正是我传递给我的CheckedTextView的值:mCheckedTextView.setCheckMarkDrawable(android.R.attr.listChoic

android - 错误 android.content.res.Resources$NotFoundException : File from xml type layout resource ID #0x102000a

嘿,我正在尝试为一个看起来像(并且大部分行为像)通话记录的列表设计,如下所示:为此,我下载了源代码,并且正在研究它以了解实现它的类和xml文件。我找到了这两个xml文件recent_calls_list_item.xml:另一个是recent_calls_list_item_layout.xml:我的Activity是这样的:publicclassRatedCallsextendsListActivity{privatestaticfinalStringLOG_TAG="RecentCallsList";privateTableLayouttable;privateCallDataHe

android - LocationManager.PROVIDERS_CHANGED_ACTION 不适用于 API 26 及更高版本

我正在使用以下代码来获取位置开/关事件。我正在开发基于地理围栏的应用程序。基于Re-registergeofencesonlywhenrequired我们必须在应用程序收到GEOFENCE_NOT_AVAILABLE警报后重新注册地理围栏。这通常发生在禁用NLP(Android的网络位置提供程序)之后。通过使用这个广播接收器,我在启用Android的网络位置提供程序时重新注册了地理围栏。但是从API级别26开始,这个广播接收器将永远无法工作。看BackgroundExecutionLimits.那么如何在API26及更高版本中完成相同的任务呢?注意:即使应用程序在后台,我也需要重新注册

android - isProviderEnabled(LocationManager.NETWORK_PROVIDER) 返回 false

我正在使用NETWORK_PROVIDER获取地点的latitude和longitude。我已经检查了“位置和安全”中的设置并启用了“使用无线网络”。但是"isProviderEnabled(LocationManager.NETWORK_PROVIDER)"总是返回false。谁能帮帮我?提前致谢!这是我的代码:LocationManagerlocManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);booleanisEnableGPS=locManager.isProviderEnabled(Loca