改变ProgressBar的可见性会导致关闭(Changing visibility of ProgressBar causes force close)
我有一个包含WebView的布局,以及以它为中心的ProgressBar。 进度条需要显示并且保存为程序(当网页内容加载时)。 但是,将ProgressBar设置为使用
loading.setVisibility(View.VISIBLE);
可见loading.setVisibility(View.VISIBLE);
,导致一个力量关闭。 如果ProgressBar默认是可见的,那么它工作正常。 如果需要,我会粘贴所有适当的代码,但我怀疑我正在做一些根本性的错误。(应该有强制关闭标记,但它既不强制关闭也不存在,我无法创建它。)
好的,代码。 setVisibility简单地说就是:
public void nowLoading() { loading.setVisibility(View.VISIBLE); }
nowLoading被称为...通过JavaScript,与WebView上的addJavascriptInterface。 啊...我想象WevView是在一个不同的线程。 我如何解决这个问题?
I have a layout containing a WebView, and a ProgressBar centred on top of it. The progress bar needs to be shown and hid programatticaly (as web content loads). However, setting the ProgressBar to be visible using
loading.setVisibility(View.VISIBLE);
, causes a force close. If the ProgressBar is visible by default it works fine. I will paste all appropriate code if needed, but I suspect I'm doing something fundamentally and simply wrong.(should have force-close tag but neither it nor forceclose exists and I can't create it.)
Okay, code. The setVisibility is simply:
public void nowLoading() { loading.setVisibility(View.VISIBLE); }
nowLoading is called... via javascript, with addJavascriptInterface on the WebView. Ahh... I imagine the WevView is in a different Thread. How do I solve that?
原文:https://stackoverflow.com/questions/6084454
最满意答案
在复制/粘贴操作期间,源和目标之间有内容类型协商。 它发生的有点像这样:
- 您将某些内容复制到复制和粘贴缓冲区中。 复制的数据或多或少都标记为MIME类型,并放置在那里。
- 粘贴时,粘贴目标会告知复制粘贴系统,它理解特定的MIME类型列表。
- 复制粘贴系统将可用格式与所需格式相匹配,并在两个列表中找到
text/html
。- 有人(可能是数据的原始来源)然后将粘贴缓冲区转换为
text/html
并将其放入编辑器中。当我在做X11 / Motif开发时(嘿,放下我的草坪,让你烂的孩子!),这就是事情的方式。所以我猜测每个人都会以同样的方式做出这样的事情。
There's a content type negotiation between the source and target during the copy/paste operation. It happens sort of like this:
- You copy something into the copy and paste buffer. The copied data is tagged with, more or less, a MIME type and who put it there.
- When you paste, the paste target tells the copy-and-paste system that it understands a specific list of MIME types.
- The copy-and-paste system matches the available formats to the desired formats and finds
text/html
in both lists.- Someone (probably the original source of the data) then converts the paste buffer to
text/html
and drops it in the editor.That's pretty much how things worked back when I was doing X11/Motif development (hey! get off my lawn you rotten kids!) so I'd guess that everyone does it pretty much the same way.
相关问答
更多-
所见即所得vs所见即所得(WYSIWYG vs WYSIWYM)[2022-06-22]
如果你的用户可以处理所见即所得,我会去那。 我正在考虑你的系统将是可视化的,也就是说,如果你说什么是一个标题,它将看起来像一个标题(否则WYS部分将不适用)。 如果用户必须手动输入标记,那么只有最精明的技术用户才能够处理它。 我对大多数用户所看到的是,他们无法给文档中的内容赋予意义。 他们不认为“这是一个标题”,他们认为“这应该更大胆和更大胆”。 不能认为“这是一个标题”的人不能处理所见即所得的问题,否则他们会觉得很难。 谁将成为您的用户群? 如果是人们撰写学术论文,我会与所见即所得一起去,因为他们在处理它 ... -
此weblink 兼容性表用于在桌面和移动浏览器中支持contenteditable属性。 会给你一个关于这个问题的线索。 我今天正在寻找同样的东西,所以我想与你分享这个链接。 This weblink Compatibility table for support of contenteditable attribute in desktop and mobile browsers. will give you a clue about this issue. I was looking for the ...
-
MediaWiki / wiki的桌面所见即所得编辑器是否可用?(Are any desktop WYSIWYG editors for MediaWiki / wiki available?)[2023-05-22]
不是真的。 有关不完善选项的解释和列表,请阅读此页面 。 但是,您可能不需要WYSIWYG编辑器,以便对wiki进行多种快速编辑。 可以下载页面的维基文本,在本地进行编辑并提交更改。 有脚本(称为机器人)可以做到这一点。 一个例子是pywikipediabot的“editarticle.py”脚本。 您可能还想看看AutoWikiBrowser 。 Not really. For an explanation and a list of imperfect options, read this page. ... -
在复制/粘贴操作期间,源和目标之间有内容类型协商。 它发生的有点像这样: 您将某些内容复制到复制和粘贴缓冲区中。 复制的数据或多或少都标记为MIME类型,并放置在那里。 粘贴时,粘贴目标会告知复制粘贴系统,它理解特定的MIME类型列表。 复制粘贴系统将可用格式与所需格式相匹配,并在两个列表中找到text/html 。 有人(可能是数据的原始来源)然后将粘贴缓冲区转换为text/html并将其放入编辑器中。 当我在做X11 / Motif开发时(嘿,放下我的草坪,让你烂的孩子!),这就是事情的方式。所以我猜测 ...
-
我不认为任何人都可以对这个问题作出权威的回答,但是我从来没有听说过一个不同的Javascript WYSIWYG编辑器。 堆栈溢出在服务器端不同。 如果您寻找服务器端组件来完成这项工作,您可能会有更好的运气。 如果您需要将差异显示为用户类型或类似内容,则可以使用AJAX将diff工作交给服务器。 I don't think anyone can authoritatively answer no to this question, but I've never heard of a Javascript W ...
-
瑞恩格罗夫的净化宝石是非常可定制的,我认为basic或relaxed模式可以用于从WYSIWYG编辑器中清理原始html(并且您不必将一堆标签列入白名单)。 Ryan Grove's sanitize gem is very customizable, and I think the basic or relaxed modes would work for sanitizing raw html from the WYSIWYG editor (and you wouldn't have to white ...
-
如何在使用前删除所见即所得编辑器的不安全内容?(How to remove unsafe contents of WYSIWYG editors before use it?)[2023-05-03]
你不应该试图自己写这种保护。 特别是,您不应该在客户端(javascript)上放置保护,而是使用像http://htmlpurifier.org/这样的服务器端过滤 You shouldn't try to write such protection on your own. Specially, you should NOT place the protection on the client side (javascript), but use instead a server side filter ... -
TinyMCE是一款流行的JavaScript所见即所得编辑器,它支持BBcode模式。 以下是BBcode示例页面的链接: http://tinymce.moxiecode.com/examples/example_09.php TinyMCE is a popular javascript WYSIWYG editor, and it supports a BBcode mode. Here's a link to their BBcode example page: http://tinymce.mo ...
-
我发现了一个解决方案,可以使用contenteditable div以及Ionic的Trix编辑器。 我将此类应用于CSS,现在我没有遇到任何问题,无论是在浏览器中还是在真实设备上进行测试: .editable{ user-select: text; -webkit-user-select: text; pointer-events: all !important; -webkit-user-modify:read-write !important; } I foun ...
-
EditText完全能够显示丰富的文本。 只是用户 - 甚至开发人员 - 没有简单的方法来真正控制格式。 因此,我一直在寻找一个库来处理这个问题 ,为EditText提供RichEditText替代品。 它仍然是一项正在进行的工作,我真的需要在不久的将来花更多的时间在它上面。 EditText is perfectly capable of displaying rich text. It's just that there's no easy way for users -- or even develo ...