Package org.robolectric.shadows
Class ShadowMessageQueue
java.lang.Object
org.robolectric.shadows.ShadowMessageQueue
- Direct Known Subclasses:
ShadowLegacyMessageQueue
,ShadowPausedMessageQueue
@Implements(value=android.os.MessageQueue.class, shadowPicker=Picker.class) public abstract class ShadowMessageQueue extends Object
The shadow API for
MessageQueue
.
Different shadow implementations will be used depending on the current LooperMode
. See
ShadowLegacyMessageQueue
and ShadowPausedMessageQueue
for details.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShadowMessageQueue.Picker
The shadow Picker for this class. -
Constructor Summary
Constructors Constructor Description ShadowMessageQueue()
-
Method Summary
Modifier and Type Method Description abstract Message
getHead()
Retrieves the current Message at the top of the queue.abstract Scheduler
getScheduler()
Return this queue's Scheduler.abstract void
reset()
Reset the messageQueue state.abstract void
setHead(Message msg)
Sets the current Message at the top of the queue.abstract void
setScheduler(Scheduler scheduler)
Set this queue's Scheduler.
-
Constructor Details
-
ShadowMessageQueue
public ShadowMessageQueue()
-
-
Method Details
-
getScheduler
Return this queue's Scheduler.Only supported in
LooperMode.Mode.LEGACY
. -
setScheduler
Set this queue's Scheduler.Only supported in
LooperMode.Mode.LEGACY
. -
getHead
Retrieves the current Message at the top of the queue.Only supported in
LooperMode.Mode.LEGACY
. -
setHead
Sets the current Message at the top of the queue.Only supported in
LooperMode.Mode.LEGACY
. -
reset
public abstract void reset()Reset the messageQueue state. Should not be called by tests - it intended for use by the Robolectric framework.
-