草庐IT

circular_reference_handler

全部标签

android - Handler.postDelayed(...) 不会延迟 Runnable

我自己实现了一个OnCompletionListener,如下所示:publicclassSongEndCompletionListenerimplementsOnCompletionListener{StringnextView;ContextactualActivity;intstopTime;publicSongEndCompletionListener(Contextactivity,StringnextView,inttime){this.nextView=nextView;actualActivity=activity;}@OverridepublicvoidonCompl

java - 异常 : Attempt to invoke virtual method 'int com.google.android.gms.location.LocationRequest.b()' on a null object reference

我已经阅读了一些相关主题,但未能解决我的问题。由于我处于学习阶段,我正在尝试实现谷歌的定位服务教程。问题是,我没有在代码中的任何地方使用“LocationRequest.b()”,但是当我按下“开始更新”按钮时出现以下错误。该应用程序随后崩溃。请让我知道我做错了什么。错误:Exception:Attempttoinvokevirtualmethod'intcom.google.android.gms.location.LocationRequest.b()'onanullobjectreference具体报错代码位置:protectedvoidstartLocationUpdates(

android - Android 上的 Facebook 分享视频异常 "ShareVideo must reference a video that is on the device"

我正在通过Gradle使用FacebookAndroidsdk4.6.0。根据SharingonFacebookguidenline配置facebook后,我正在尝试从移动目录上传视频,但我在调用sharedialog.show后遇到异常“ShareVideo必须引用设备上的视频”。异常是通过`onError(FacebookException异常)的回调向我报告的。/**firstcheckingiffileexistthanexecutecode,fileexitsandcodeexecutebutafterexecutingcallbackwithexception"ShareV

android - 初始化 SharedPreferences 给出 : Attempt to invoke virtual method on a null object reference

当我启动我的应用程序时,它崩溃了,并给我这个错误代码。Attempttoinvokevirtualmethod'android.content.SharedPreferencesandroid.content.Context.getSharedPreferences(java.lang.String,int)'onanullobjectreference这是我的主要Activity:packagecom.awplicity.testappshared;importandroid.content.Context;importandroid.content.Intent;importand

android - 错误 : <item> inner element must either be a resource reference or empty?

最近我将我的项目升级到AndroidStudio3.2.1、Gradel4.6、GradlePlugin4.6和tagetSDKVersion28。但是我在合并的values.xml文件中遇到以下错误-error:innerelementmusteitherbearesourcereferenceorempty.导致问题的合并values.xml中的行-falsefalsefalsefalsefalsefalsefalsefalsefalse准确的错误日志AndroidresourcecompilationfailedOutput:C:\AmrutData\Workspace\Q4\M

android - 此 Handler 类应该是静态的,否则可能会发生泄漏 (com.test.test3.ui.MainActivity.1)

我是android的新手,我尝试开发一个系统,但是当我完成代码时,处理程序显示此警告下面显示我编辑后的代码,事件ontounch中的处理程序显示警告处理程序无法解析。我尝试在我尝试运行应用程序时将//忽略处理程序,并强制关闭它的结果。publicclassMainActivityextendsActivity{protectedstaticfinalintSTOP=100;ImageViewiv;privateProgressBarpb;LinearLayoutll;privateAnimationDrawableanim;ScrollViewsv;privateSQLiteDatab

android - 显示错误 :Attempt to invoke interface method 'int java.util.List.size()' on a null object reference

我正在创建一个在ListView中显示联系人列表的应用程序。问题是我在运行我的应用程序时遇到以下错误并且我正在努力修复它:04-0513:41:48.8682488-2488/?E/AndroidRuntime:FATALEXCEPTION:mainProcess:com.kksworld.jsonparsing,PID:2488java.lang.NullPointerException:Attempttoinvokeinterfacemethod'intjava.util.List.size()'onanullobjectreferenceatandroid.widget.Arra

java - 渲染期间引发异常 : Circular dependencies cannot exist in RelativeLayout Exception details are logged in Window > Show View > Error Log

突然eclipse开始报错。“渲染期间出现异常:RelativeLayout中不能存在循环依赖项异常详细信息记录在Window>ShowView>ErrorLog"这是我的xml文件。我该怎么做才能解决这个问题? 最佳答案 问题是因为布局参数存在循环引用引起的。例如,当ViewB是layout_belowViewA时,ViewA不能再在其下方引用ViewB,alignRight等。这也可以存在于多个View之间:A引用B引用C。在那种情况下,C不能由于循环依赖而引用A。您需要再次评估引用文献。它会给你行号吗?编辑:当我从androi

android - 为什么设置了HandlerThread looper的Handler可以和UI Object交互?

为什么这段代码有效?@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Log.i("onCreate",Thread.currentThread().toString());textView=(TextView)findViewById(R.id.textView);imageView=(ImageView)findViewById(R.id.imageView);Handle

android - java.exe 已退出,代码为 2 (MSB6006) 无法写入输出 : Too many field references: 81626; max is 65536

我正在开发xamarinandroid应用程序,并在其中使用了许多包和引用(Googleplay服务)。当我尝试构建此项目时出现此错误:java.exeexitedwithcode2Troublewritingoutput:Toomanyfieldreferences:81626;maxis65536.Youmaytryusing--multi-dexoption. 最佳答案 您需要启用Mutlidex在你的项目中。Xamarin.Android自version5.1起支持此功能:Multi-dexsupportcanbeenabl