Test if ContentProvider exists ?

by Lee » Tue, 01 Jun 2010 23:45:51 GMT


Sponsored Links
 How can I test if there's a ContentProvider for a Uri ?

I'm currently doing a query on it and checking for a null cursor, but
that generates an error in the system log each time, which I don't
like to do.

Pent

--



Test if ContentProvider exists ?

by Mark Murphy » Wed, 02 Jun 2010 00:40:50 GMT


 


You should be able to use methods on PackageManager for that.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.5 Available!

--


Sponsored Links


Test if ContentProvider exists ?

by Lee » Wed, 02 Jun 2010 01:30:02 GMT


 Looks promising, thanks.

Lee






--



Other Threads

1. Service.onDestroy() invalid?

I use AlarmManager to restart my service, code is:

AlarmManager aman = (AlarmManager)getSystemService
(Context.ALARM_SERVICE);
PendingIntent pi = PendingIntent.getBroadcast(this,0, new Intent
(this,BootCompleteReceiver.class), 0);
aman.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+(1000)*5,
pi);
this.onDestroy();

after 5 seconds, BootCompleteReceiver will startServcie(), but only
see onStart() not onCreate() calls. Is the way of destroying the
service wrong? Thanks.

BootCompleteReceiver is written in AndroidManifest.xml
--~--~---------~--~----~------------~-------~--~----~

2. ApplicationContext.java and Activity.java. Is ApplicationContext not used ?

Yes, I agree it is confusing, but it is not in the SDK so not a high
priority to go through all the effort of changing.










-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

3. Regarding short cut icon

4. language/region combinations in Europe

5. libdrm1.so and libdrm1_jni.so, what are those libs purpose ?

6. Two apps... Same Preferences

7. GLSurfaceView is black after incoming call