Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

android - Implementing AsyncQueryHandler

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.

I tried doing

AsyncQueryHandler handler = new AsyncQueryHandler(getContentResolver());

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's so convenient:

AsyncQueryHandler handler = 
    new AsyncQueryHandler(mActivity.getContentResolver()) {};
handler.startUpdate(-1, null, sessionUri, values, null, null);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...