`
guoyiqi
  • 浏览: 1014137 次
社区版块
存档分类
最新评论

解决Android中Can't create handle inside thread问题

 
阅读更多


如果在上述代码中省略号处面创建一个Dialog的话会出现Can't create handle inside thread这样的错误,所以改用下述message形式的,下述是一个开发项目中具体的例子。


其中

是调用一个显示Dialog的自定义的方法。

这种发送message的方式模型抽取出来就是下面的形式:




然后在其他某处调用


就可取消此message的发送。

其实这里发送message也是一种线程,相当于设置一个定时器,每隔一段时间执行某些代码一样。

分享到:
评论

相关推荐

    一本android的好书beginning android 2 和 源码

    android好书系列,我目前找了两本,先贡献给大家。以后如果有好的资源,再上传和大家分享。 本资源是第一本。 这是一本学习android的好书,我浏览了,是老外著的,高清晰的pdf。为了方便大家学习android,我将本书所...

    apktool documentation

    Can't find framework resources for package of id: 2. You must install proper framework files, see project website for more info. We must get HTC framework resources before decoding this apk. We pull ...

    微软内部资料-SQL性能优化2

    By leveraging the Address Windowing Extensions API, an application can create a fixed-size window into the additional physical memory. This allows a process to access any portion of the physical ...

    Java_for_the_Web_with_Servlets

    - **`GenericServlet` Wrapper Class**: This abstract class provides a convenient implementation of the `Servlet` interface and can be extended to create custom servlets. - **Thread-Safe Servlets**: ...

    EurekaLog_7.5.0.0_Enterprise

    4)....Added "--el_injectjcl", "--el_createjcl", and "--el_createdbg" command-line options for ecc32/emake to inject JEDI/JCL debug info, create .jdbg file, and create .dbg file (Microsoft debug format...

    Managed IO Completion Ports.docx

    Create an IOCP using the `IOCompletionPort` constructor, passing in the handle of the I/O resource you want to associate with the port. b. Register I/O operations using methods like `...

    微软内部资料-SQL性能优化3

    A set of transactions can run concurrently if their outputs are disjoint from the union of one another’s input and output sets. For example, if T1 writes some object that is in T2’s input or output ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    link ▶Don't use an #include when a forward declaration would suffice. When you include a header file you introduce a dependency that will cause your code to be recompiled whenever the header file ...

    CSharp 3.0 With the .NET Framework 3.5 Unleashed(english)

    Based on the provided information from the book "C# 3.0 With the .NET Framework 3.5 Unleashed," we can extract several key points and concepts that are essential for understanding the fundamentals of ...

    Total.Commander.v7.55.RC2.Multilingual.WinALL.Cracked-BLiZZARD

    You can even view files inside archives! 捋? 圹? New: Support for Unicode UTF-8 format. 捋? 圹? - Bitmap viewer in Lister, additional formats through Irfanview 捋? 圹? - ...

    Visual C++ 编程资源大全(英文源码 控件)

    1,01.zip 3D Text 显示3D文字(6KB)<END><br>2,02.zip A button within a button 按纽中的按纽(13KB)<END><br>3,03.zip Flat Owner Drawn Buttons 浮动的自画按纽(13KB)<END><br>4,04.zip Flat-...

    python3.6.5参考手册 chm

    PEP 479: Change StopIteration handling inside generators PEP 485: A function for testing approximate equality PEP 486: Make the Python Launcher aware of virtual environments PEP 488: Elimination of...

Global site tag (gtag.js) - Google Analytics