实施AsyncQueryHandler [英] Implementing AsyncQueryHandler

查看:155
本文介绍了实施AsyncQueryHandler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现 AsyncQueryHandler ,因为我遇到这个完全相同的问题,<一个href="http://stackoverflow.com/questions/11604914/contentprovider-insert-always-runs-on-ui-thread">link但我没有看到任何其实现的例子或任何东西。

I am trying to implement AsyncQueryHandler because I am experiencing the same exact problem in this link but I dont see any example or anything about implementing it.

我试图做

AsyncQueryHandler handler = new AsyncQueryHandler(getContentResolver());

因为这是构造显示在文档但我得到一个错误说无法实例的类型AsyncQueryHandler 让我怎么使用它呢?

since that is what the constructor shows in the docs but I get an error saying cannot instantiate the type AsyncQueryHandler so how do I use it then?

推荐答案

<一个href="http://developer.android.com/reference/android/content/AsyncQueryHandler.html">AsyncQueryHandler是一个抽象类,所以你不能直接实例化。你需要它的子类。

AsyncQueryHandler is an abstract class, thus you cannot instantiate it directly. You need to subclass it.

这篇关于实施AsyncQueryHandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆