ACRA崩溃报告是否也需要服务许可?(Does ACRA crash reporting also require service permission?)
整合崩溃报告的ACRA文档由3个简单的步骤组成:
2 - 将以下内容添加到AndroidManifest.xml中
<!-- in the manifest, not the application tag --> <uses-permission android:name="android.permission.INTERNET" />
和
<application ... android:name=".MyApplication"> ... </application>
3 - 创建一个与上面的'MyApplication'具有相同名称的新Java类:
import org.acra.*; import org.acra.annotation.*; @ReportsCrashes(formUri = "http://www.yourselectedbackend.com/reportpath") public class MyApplication extends Application { @Override public void onCreate() { // The following line triggers the initialization of ACRA super.onCreate(); ACRA.init(this); } }
这应该是它。 我认为这些说明已经过时了,AndroidManifest.xml自那时起就有了进步。
我还需要在我的
<application> ... </application>
以下内容才能正常工作:<service android:name="org.acra.sender.SenderService" />
问题:我做错了什么,或者是否有Android需求发展,我做得正确?
无论哪种方式,我也想分享/记录我的步骤,以防其他人遇到同样的问题。
The ACRA documentation to integrate crash reporting consists of 3 simple steps:
2 - Add the following to the AndroidManifest.xml
<!-- in the manifest, not the application tag --> <uses-permission android:name="android.permission.INTERNET" />
and
<application ... android:name=".MyApplication"> ... </application>
3 - Create a new java class with the same name as above 'MyApplication':
import org.acra.*; import org.acra.annotation.*; @ReportsCrashes(formUri = "http://www.yourselectedbackend.com/reportpath") public class MyApplication extends Application { @Override public void onCreate() { // The following line triggers the initialization of ACRA super.onCreate(); ACRA.init(this); } }
That's supposed to be it. I think the instructions are a bit out of date and that the AndroidManifest.xml has evolved since then.
I also needed to add the following inside my
<application> ... </application>
for it to function:<service android:name="org.acra.sender.SenderService" />
Question: Am I doing something wrong or have Android requirements evolved and I'm doing it correctly?
Either way I also want to share/document my steps in case others have the same problems.
原文:https://stackoverflow.com/questions/36013868
最满意答案
不要使用复选框,使用带有CSS图像背景的链接。 将事件处理程序连接到链接,然后您可以在单击时更改CSS类名以交换函数中的图像。
Don't use a checkbox, use a link with an CSS image background. Hook up the event handler to the link and you can then change CSS class names on click to swap the image within your function.
相关问答
更多-
您只需要更新已更改的元素的checked属性,您可以通过在change事件回调中使用它来访问它的对象 $(".check").on("change", function() { $(this).attr('checked',this.checked); // updating checked attribute of change event occurred element, this.checked returns current state $(".wrapper").val( $( ...
-
复选框图像(Checkbox Images)[2021-09-30]
您有大量不必要的代码,并将初始图像值设置为不存在的图像。 此外,您的HTML无效( 结束标记必须是文档中的最后一项)。 此外, 您不应使用内联HTML事件属性 ( onclick等),而是将JavaScript与HTML完全分离,并遵循基于标准的现代编码实践。 此外,除非您希望在某些时候(非常不可能)将HTML解析为XML,否则可以省略元素中的最后一个斜杠( 只能是 )。 同样,您不再需要在脚本标记中指定type="text/javascript ... -
我发现这个问题完全回答了我的问题: 关键值观察和NSButton状态 I found this question on SO that answered my question perfectly: Key Value Observing and NSButton state
-
如果checkbox ,则可以设置类似的条件,然后替换您想要的图像/文本,如果unchecked则将其替换为原始文件。 $("#link_checkbox").click(function () { if ($(this).is(":checked")) { $(".result_text").text("Inserts the contents of the file into your document and creates a shortcut to the source f ...
-
您可以简单地为Checkbox定义自己的ControlTemplate ,在其中显示图像而不是默认打勾。 您可以在MSDN上的“ 复选框样式和模板”页面中找到Checkbox的默认ControlTemplate 。 在定义自己的ControlTemplate ,从默认开始使用它通常是一个好主意。 让你的项目工作,然后你可以开始调整它的喜好。 这样,它应该保留用户从Checkbox中使用的所有默认行为。 但是这是我们在这里讨论的WPF ......有一点侧面思考,很容易让几个控件看起来像其他控件。 例如,下面 ...
-
不要使用复选框,使用带有CSS图像背景的链接。 将事件处理程序连接到链接,然后您可以在单击时更改CSS类名以交换函数中的图像。 Don't use a checkbox, use a link with an CSS image background. Hook up the event handler to the link and you can then change CSS class names on click to swap the image within your function.
-
这样的事情? http://jsfiddle.net/KADqA/23/只需在图像中添加一些样式,就可以了。 (在这种情况下,javascript并不是很有用。是关于如何在此字段中添加链接的示例: http : //jsfiddle.net/KADqA/ ) something like that? http://jsfiddle.net/KADqA/23/ just add some styling to the image, should work. (the javascript is not rea ...
-
方法调用$(this).val()返回复选框的值。 从你的html片段中,模式应该是在组合框中选择的选项的值。 如果我理解正确,这应该完成你想要的: // Update the background image on the body tag when: // a) A new pattern is selected, or // b) The solid checkbox is checked or unchecked $('#patterns, #solid').change(function( ...
-
通过复选框在多个元素上使用`this`更改占位符(Changing placeholder with `this` on multiple elements via checkbox)[2023-03-19]
以下JS将使用类SearchInput在文本输入上设置占位符。 我假设你想要占位符而不是原始代码隐含的translateSearch复选框。 还会进行更改,以便在选中此框时还原原始占位符文本。 $('.translateSearch').on('change', function(e) { if ($(this).prop('checked')) { $('.SearchInput').attr('placeholder', 'Have your search terms translated ... -
你可以试试这个 $(function(){ $('#Lines').on('change', function(){ if($(this).is(':checked')) { $("body").css({ 'background-image': 'url(image url)' }); } else $("body").css({'background-image':''}); }); }); ...