WP7检测线程(WP7 detect thread)

有没有办法可以检测到一行代码所在的线程?

我正在使用Background Audio Agent,我想检测它所处的进程和线程?


Is there any way that can detect which thread a line of code is in?

I'm working with Background Audio Agent and I want to detect what process and thread it is in ?


原文:https://stackoverflow.com/questions/12722335
2022-04-16 11:04

满意答案

这是一个Android错误,它不是你的代码。 在代码中放置一个try / catch块以避免崩溃。


It's an Android bug it's not your code. Put a try/catch block in your code to avoid the crash.

相关问答

更多

总是空指针异常(always null pointer exception)

这是因为你没有为e2传递价值。 简单地改变: e1 = (EditText)findViewById(R.id.isiharga); e1 = (EditText)findViewById(R.id.isilaba); 至 e1 = (EditText)findViewById(R.id.isiharga); e2 = (EditText)findViewById(R.id.isilaba); It's because you're not passing value for e2. Simp...

接收空指针异常(Receiving a null pointer exception)

虽然你用空字符串初始化了checker3 ,但它被checker = scan.findWithinHorizon(pattern, 0); 这似乎是返回null 。 要避免NullPointerException您应该在if语句中添加null check - if(checker!=null && checker.equals("Array Start")){ ... }else{ ... } Though you have initialized checker3 with em...

仅在平板电脑上的空指针异常(null pointer exception only on tablet)

// Get the camera private void getCamera() { if (camera == null) { camera = Camera.open(); if (camera != null) { params = camera.getParameters(); } } } 你想抓住NullPointerException吗? 别。 考虑更改函数的名称。 Getters返回一些东...

Junit - 与@Before的空指针异常(Junit - Null Pointer Exception with @Before)

进口(木星)表明你正在使用Junit5。 在JUnit5中,您必须使用@BeforeEach注释来指示在每个测试方法之前必须执行的步骤。 @Before中使用了@Before注释。 我没有测试过,只需阅读文档https://junit.org/junit5/docs/current/user-guide/ The imports (jupiter) indicate you're using Junit5. In JUnit5 you have to use the @BeforeEach ann...

音频管理器setStreamMute vs setStreamVolume为0(Audio Manager setStreamMute vs setStreamVolume to 0)

我不确定其他应用程序,但最终确实是我的应用程序的差异。 如果将系统流的音量设置为0,则最终会将手机设置为振动。 但如果你静音流,这种副作用就不会发生。 I'm unsure for other applications, but there did end up being a difference in my application. If you set the volume of the System Stream to 0, you end up setting the phone to ...

获取空指针异常(getting null pointer exception)

Chnage if(String.valueOf(spinner1.getSelectedItem())=="Small") 至 if(String.valueOf(spinner1.getSelectedItem()).equals("Small")) 使用.equals或.equalsIgnoreCase来比较字符串 而不是使textview静态,你应该使用意图在活动之间传递值。 Intent intent = new Intent(ActivityName.this,Settings....

Firebase空指针异常(Firebase null pointer exception)

您以错误的方式使用getValue()。 应该 String val= dataSnapshot.child("myvalue").getValue(String.class); 要检查,如果值存在,您可以将dataSnapshot转换为Hashmap,就像这样 HashMap<String, Object> hashmap = (HashMap) dataSnapshot.getValue(); String val= hashmap.get("myvalue"); You are usin...

AudioManager setStreamMute()空指针异常(AudioManager setStreamMute() Null Pointer Exception)

这是一个Android错误,它不是你的代码。 在代码中放置一个try / catch块以避免崩溃。 It's an Android bug it's not your code. Put a try/catch block in your code to avoid the crash.

getElementById获取空指针异常(getElementById is getting null pointer exception)

您正在打开文件并为其写入空格字符,然后读取此文件以进行解析。 当您使用PrintWriter这会清除您的文件。 那么这里发生的是首先清除文件,然后尝试解析它。 这就是null指针的原因 如果你想从url那里得到它,你可以这样做 public void get_content(String eliment_by, String identification) { try { org.jsoup.nodes.Document doc = Jsoup.connect("http...

数组和空指针异常问题(Arrays & Null Pointer Exception Issue)

您在ModelingAgency构造函数中隐藏了实例变量modelList ,因此初始化具有相同名称的局部变量。 更改 Model[] modelList = new Model[4]; 至 modelList = new Model[4]; You're shadowing your instance variable modelList in your ModelingAgency constructor and therefore initializing a local variabl...

相关文章

更多

线程报错 thread

/** * 只能这么写 * 不然 腾讯微博会报Can't create handler inside ...

WP7 Mango可用性之我见

之前使用了一段时间Android手机,日常用到的功能主要有: Google Contacts同步 ...

引入thread后socket接受不了报文了

不使用线程thread可以正常接受报文,加了后就在recvfrom那里不动了,是怎么回事? usin ...

关于Thread类中的start()方法和run()方法

引用 public void start() Causes this thread to ...

一步一步掌握java的线程机制(二)----Thread的生命周期

之前讲到Thread的创建,那是Thread生命周期的第一步,其后就是通过start()方法来启动Th ...

《Windows Phone 7.5专题讲座之WP7入门系列》共10课时/更新完毕[压缩包]

中文名: Windows Phone 7.5专题讲座之WP7入门系列 资源格式: 压缩包 ...

wordpress wp_mail

$info .= &quot;微信: &lt;a href='http:// wx.jpg'&gt;h ...

关于线程

线程,学了挺久了。我发现我不会写总结这种东西。 好吧,我又词穷了。不知道该怎么写了。先打开eclips ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本