Getting android.intent.action.MEDIA_SCANNER_FINISHED

by Ilan » Sat, 14 Mar 2009 06:16:18 GMT


Sponsored Links
 Hi.

I'm trying to grab the android.intent.action.MEDIA_SCANNER_FINISHED
(Correct me if I'm wrong but this event will be pushed after the media
scanner scanned directory or a file) using an intent filter with no
luck. My manifest looks like this:

<receiver android:name="reboot">
    <intent-filter>
        <action
android:name="android.intent.action.MEDIA_SCANNER_FINISHED"></action>
    </intent-filter>
</receiver>

But no joy, what am I doing wrong? Any help will be appreciated.

Cheers.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Looper.LoopOnce?

I have a thread that does all my rendering code for a game (including
animations).  I want to be able to communicate with that thread via
Messages instead of locking / synchronization.  This means that I need
to both support a message queue and *also* support my own rendering
loop.  Normally I would just clear the message queue every frame of
rendering so worst case scenario the messages sit on the queue for one
frame before getting cleared out.  This also gives a bit of priority
to messages in that if the queue backs up the rendering will take a
back seat until it empties out.

Everything was going fine until I realized that Looper doesn't have a
"Clear the Queue" function!  I looked at the source code for
Looper.loop() and it appears that the code necessary to manually
traverse the MessageQueue is protected, so I can't even write the
ClearQueue function myself.

Does anyone here have any feedback on how I can have a thread that
keeps the MessageQueue clear at the same time as allowing me to peg
the CPU rendering as many frames per second as I can?

My current thought is to insert a message into the MessageQueue along
the lines of "RenderOneFrame".  When this message is popped off the
queue I would render one game frame. Before returning from my
rendering code though I would push another copy of the RenderOneFrame
message back onto the queue.  This means any messages added to the
queue while I was busy rendering the frame would get processed before
the RenderOneFrame mesage and once the queue was "clear" (ie:
RenderOneFrame message was back on top) I would repeat the process.

I suspect that this will work, though I am open to suggestions for
either a clear or faster method (I'm more interested in clean at this
point, but at optimization time I'll be interested in faster if I
bottleneck on this code).
--~--~---------~--~----~------------~-------~--~----~

2. multiple-process in single application.

HI,

      I need  two activities run in different processes in the same
application. Now I have made it work by specifying the different
process name in "android:process".

        But I met a problem,  from
http://developer.android.com/guide/topics/manifest/application-element.html#nm,
we have only one superclass of Application will run before the
activity starts(I have tested it, and each time a after new processes
start, this Application(its superclass) will run before activity).
But, my two activities have two different superclasses of
Applications. So, how to make Applications for different activities
run for its corresponding activity?

       If there is no way to use different Application class for
different activity, how can I make a flag for the common Application
superclass to judge which process(by getting its name) is running?

      BTW, the two activities were on the separated development flow
and I am trying to merge them.

Thanks a lot.
--~--~---------~--~----~------------~-------~--~----~

3. handeling StartActivityForResult on back button

4. html in button

5. Android GUI testing

6. Multi-touch & My Touch Phone Questions

7. JNI_OnLoad (). Is it mandatory?