A simplest Application access "Content Provider"

by Dianne Hackborn » Thu, 06 May 2010 05:40:43 GMT


Sponsored Links
 Please don't spam questions across every android group in the world.




> website: 



A simplest Application access "Content Provider"

by linlone9 » Thu, 06 May 2010 10:51:57 GMT


 orry,

I've corrected it.
If you have any idea about this issue, please help check it.

Thanks.


2010/5/5 Mateusz Kozak <mateuszkozak...@gmail.com>


--


Sponsored Links


A simplest Application access "Content Provider"

by grace » Thu, 06 May 2010 13:51:05 GMT


 i,


getcontentResolver() is the method of Context class which is the super
class of activity,

so any non activity class cannot get access to the content resolver
object..
one work around(even though its not good practice to do..)pass the
content resolver object as parameter to the function you want to use
it from another class which is a activity,
but in your case i don't think you have that option of passing content
resolver object from another class as you have only one class that is
calling main in your program.


On May 6, 7:51am, linlo...@gmail.com wrote:
>



Other Threads

1. Error generating final archive ... post Apple Software Update

Today, when I try to run my app from Eclipse, I get "Error generating
final archive: Debug certificate expired on 9/21/2009 6:11pm".

I ran Software Update on my Mac a few days ago (probably around
9/21/2009 at 6:11pm).  I mention this because its the only thing that
has changed with my machine since I last worked on my app.  I tried a
few of the suggestions on the board - deleted debug.keystore and tried
opening Eclipse using sudo.  Neither did the trick.

Anyone else?  Suggestions super welcome.

Thank You,
Jason Van Anden
www.bubblebeats.com

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

2. SDCARD images/audio/video not reflected in gallery.

Hi all,

I have pushed around 10 files of each image(*.png ), audio(*.mp3) and 
video(*.mp4 & *.3gp) after that I have restarted the emulator and when I open 
the gallery application I see only a few files being present in sdcard. (in my 
case 1 video, 2 images and 2 audio clips) . 

is this a bug in emulator?

because I have written a piece of code that displays the images/audio/video . 
But due to above mentioned issue I'm not able to display/play the images. 

snippet of implementation is as follows:

public void displayImages(){
Uri uri = MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI; 
    String[] projection = { 
    MediaStore.Images.ImageColumns._ID,
    MediaStore.Images.ImageColumns.DATA        
    };

    mCursor = this.managedQuery(uri, projection, null, 
null,MediaStore.Images.Thumbnails.IMAGE_ID + "");
Log.i("MP", "Total Number of images present on sdcard"+mCursor.getCount());     
   
....
...
...
...
}

public void playAudios(){
    Uri uri = MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI; 
    String[] projection = {     
            MediaStore.Audio.AudioColumns._ID   }; 
    mCursor = this.managedQuery(uri, projection, null, null, 
MediaStore.Audio.AudioColumns._ID + "");
Log.i("MP", "Total Number of images present on sdcard"+mCursor.getCount());     
   
...
...
...
}

public void playVideos(){
Uri uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; 
    String[] projection = { 
            MediaStore.Video.VideoColumns._ID   };
    mCursor = this.managedQuery(uri, projection, null, null, 
MediaStore.Video.VideoColumns._ID + "");
Log.i("MP", "Total Number of images present on sdcard"+mCursor.getCount());     
   
...
...
...
}


in above all the 3 cases I get the mCursor.getCount() less than the actual 
number of respective files present on the sdcard. can someone guide me where 
I'm going wrong. 


Thanks 
umesh. 


      Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew
--~--~---------~--~----~------------~-------~--~----~

3. Problem in Listview with Checkbox

4. getting crash stack....

5. Activity.isForeground()

6. See the Google app store without having cell phone service ??

7. Potential issues I've found with the way ADC2 is working for games