jjzjj

hierarchy

全部标签

android - 异步任务 OnProgressUpdate CalledFromWrongThreadException : Only the original thread that created a view hierarchy can touch its views

我正在使用AsyncTask下载带有进度对话框的数据库,该进度对话框在UI上显示进度。我的一些用户收到错误:CalledFromWrongThreadException:只有创建View层次结构的原始线程才能触及它的View。据我了解,只有当您尝试从UI线程更新View时才会发生这种情况。这是错误:com...updateops.DbCreate.onProgressUpdate(DbCreate.java:70)在com...updateops.DbCreate.onProgressUpdate(DbCreate.java:1)这是我的代码:publicclassDbCreateex

java - 如何使 "Hierarchy Viewer"在真实设备中工作?

我是android开发的新手,我开始使用“HierarchyViewer”...它与sdk附带的模拟器一起工作正常。问题是我想在真实设备上使用它。我进行了研究,发现出于安全原因,它只能在各种来源的模拟器和开发者手机上运行。OfficialAndroidDeveloperSite但我也发现,通过在我们的项目中使用“ViewServer.java”,我们可以在真实设备上使用这个工具。GitHubromainguy/ViewServerLink:据我所知,有两件事要做......将这个ViewServer.java包含到我们的项目中在list中添加INTERNET权限。()并且在阅读java

android - Hierarchy Viewer 中的绘制时间错误?

我正在使用AndroidSDK附带的HierarchyViewer工具进行一些测试。我正在测试的Activity具有以下xml:SlowDrawView扩展了TextView但我修改了onDraw()如下:@OverrideprotectedvoidonDraw(Canvascanvas){try{Thread.sleep(3000L);}catch(InterruptedExceptione){e.printStackTrace();}super.onDraw(canvas);}当我在hv中检查此View的绘制时间时,我注意到它少于3segs,这没有任何意义。知道为什么会这样吗?我还

android - 没有延迟更新 View 时没有错误 "Only the original thread that created a view hierarchy can touch its views"

我遇到了一个有趣的问题。如果在activity的onCreate/onStart/onResume方法中写入如下代码:finalButtonmyButton=(Button)findViewById(R.id.myButton);finalTextViewmyTextView=(TextView)findViewById(R.id.myTextView);finalThreadthread=newThread(newRunnable(){@Overridepublicvoidrun(){myTextView.setText("Hellotext");}});myButton.setOn

android - Lollipop Lost WebView View Hierarchy 的 UiAutomator 转储

在KitKat中,如果焦点放在webview上,我们能够从UIAutomator转储中获取webviewView层次结构。我想知道Lollipop版本是否有替代功能来获取webviewView层次结构,或者该功能是否在该版本中丢失了? 最佳答案 我花了一些时间来解决这个问题,但基本上,出于实用目的,是的,这个功能在这个版本中丢失了。有一些笨拙的解决方法,但它们并不可靠。最好的办法是编写一个由uiautomator运行的实际单元测试,并使用dumpWindowHierarchy自己提取的API。如果您这样做,请务必确保您希望提取的We

android - 异步任务 "Only the original thread that created a view hierarchy can touch its views."

我尝试跨AsyncTaks修改Spinner内容,但我不能,Logcat写为“09-1916:36:11.189:ERROR/ERRORTHE(6078):只有创建View层次结构的原始线程可以触摸它的View。”。publicclassGetGroupsextendsAsyncTask{@OverrideprotectedVoiddoInBackground(Void...params){Spinnercombo=(Spinner)findViewById(R.id.group_combo);setGroups(combo);returnnull;}@Overrideprotecte

android - 启动布局检查器时为 "Error obtaining view hierarchy: Unexpected error: empty view hierarchy"

启动布局检查器时收到错误消息:“获取View层次结构时出错:意外错误:空View层次结构”。同样在Logcat中有一个异常(exception):12-1023:46:56.81218833-18840/com.tst.nikita.yandextranslaterI/art:Exceptionthrownbydispatcherfor0x5655525412-1023:46:56.81218833-18840/com.tst.nikita.yandextranslaterW/System.err:java.lang.NoClassDefFoundError:android.graph

安卓测试 : Waited for the root of the view hierarchy to have window focus

在AndroidUi测试中,我想点击对话框中的微调项,但弹出此错误:va.lang.RuntimeException:Waitedfortherootoftheviewhierarchytohavewindowfocusandnotberequestinglayoutforover10seconds.Ifyouspecifiedanondefaultrootmatcher,itmaybepickingarootthatnevertakesfocus.Otherwise,somethingisseriouslywrong.SelectedRoot:Root{application-win

android - 获取 UI 层次结构时出错 Error while obtaining UI hierarchy XML file : com. android.ddmlib.SyncException: Remote object doesn't exist

我正在使用adb测试我的应用程序,但是当我执行“为uiautomator转储View层次结构”时出现此错误:ErrorobtainingUIhierarchyErrorwhileobtainingUIhierarchyXMLfile:com.android.ddmlib.SyncException:Remoteobjectdoesn'texist!我的adb版本是1.0.36,我的android版本是6.0.1。只有当界面中有动态元素在运动时才会出现此错误。提前致谢。 最佳答案 最好的方法是杀死adb服务器并重新启动它。sudoad

android - 错误 : Only the original thread that created a view hierarchy can touch its views

您好,感谢您查看我的问题。我是C的中级程序员,但Android新手。我一直在尝试让聊天程序正常工作。假设下面代码中的其他一切都完美无缺。我想问的一个问题是,当我尝试从正在运行的线程中setText()时,出现了上面的异常。我看了很多网站,也看了这里。发现了很多东西,但是我真的不明白。请以最简单的方式向我解释,或者尽可能提供一些简单的修复方法。非常感谢!!publicclasschatterextendsActivity{privateStringname="UnknownUser";/**Calledwhentheactivityisfirstcreated.*/@Overridepu