|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xtremelabs.robolectric.shadows.ShadowContext
com.xtremelabs.robolectric.shadows.ShadowContextWrapper
com.xtremelabs.robolectric.shadows.ShadowApplication
@Implements(value=android.app.Application.class) public class ShadowApplication
Shadows the android.app.Application
class.
Nested Class Summary | |
---|---|
class |
ShadowApplication.Wrapper
|
Constructor Summary | |
---|---|
ShadowApplication()
|
Method Summary | |
---|---|
void |
assertNoBroadcastListenersRegistered(android.content.Context context,
java.lang.String type)
Iterates through all of the registered receivers on this Application and if any of them match the given
Context object throws a RuntimeException |
static android.app.Application |
bind(android.app.Application application,
com.xtremelabs.robolectric.res.ResourceLoader resourceLoader)
Associates a ResourceLoader with an Application instance |
android.content.Context |
getApplicationContext()
|
android.appwidget.AppWidgetManager |
getAppWidgetManager()
Non-Android accessor. |
android.content.ContentResolver |
getContentResolver()
|
android.view.LayoutInflater |
getLayoutInflater()
Non-Android accessor. |
android.content.Intent |
getNextStartedActivity()
Consumes the most recent Intent started by startActivity(android.content.Intent) and returns it. |
android.content.Intent |
getNextStartedService()
Consumes the most recent Intent started by startService(android.content.Intent) and returns it. |
java.util.List<ShadowApplication.Wrapper> |
getRegisteredReceivers()
Non-Android accessor. |
com.xtremelabs.robolectric.res.ResourceLoader |
getResourceLoader()
Non-Android accessor (and a handy way to get a working ResourceLoader |
android.content.res.Resources |
getResources()
|
java.lang.Object |
getSystemService(java.lang.String name)
|
android.content.Intent |
peekNextStartedActivity()
Returns the most recent Intent started by startActivity(android.content.Intent) without
consuming it. |
android.content.Intent |
peekNextStartedService()
Returns the most recent Intent started by startService(android.content.Intent) without
consuming it. |
android.content.Intent |
registerReceiver(android.content.BroadcastReceiver receiver,
android.content.IntentFilter filter)
Always returns null |
void |
sendBroadcast(android.content.Intent intent)
Broadcasts the Intent by iterating through the registered receivers, invoking their filters, and calling
onRecieve(Application, Intent) as appropriate. |
void |
startActivity(android.content.Intent intent)
|
android.content.ComponentName |
startService(android.content.Intent intent)
|
void |
unregisterReceiver(android.content.BroadcastReceiver broadcastReceiver)
|
Methods inherited from class com.xtremelabs.robolectric.shadows.ShadowContextWrapper |
---|
__constructor__, getPackageManager, getPackageName, getSharedPreferences |
Methods inherited from class com.xtremelabs.robolectric.shadows.ShadowContext |
---|
getString, getString, getText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShadowApplication()
Method Detail |
---|
public static android.app.Application bind(android.app.Application application, com.xtremelabs.robolectric.res.ResourceLoader resourceLoader)
ResourceLoader
with an Application
instance
application
- applicationresourceLoader
- resource loader
@Implementation public android.content.Context getApplicationContext()
getApplicationContext
in class ShadowContextWrapper
@Implementation public android.content.res.Resources getResources()
getResources
in class ShadowContextWrapper
@Implementation public android.content.ContentResolver getContentResolver()
getContentResolver
in class ShadowContextWrapper
@Implementation public java.lang.Object getSystemService(java.lang.String name)
getSystemService
in class ShadowContextWrapper
@Implementation public void startActivity(android.content.Intent intent)
startActivity
in class ShadowContextWrapper
@Implementation public android.content.ComponentName startService(android.content.Intent intent)
startService
in class ShadowContextWrapper
public android.content.Intent getNextStartedActivity()
Intent
started by startActivity(android.content.Intent)
and returns it.
getNextStartedActivity
in class ShadowContextWrapper
Intent
public android.content.Intent peekNextStartedActivity()
Intent
started by startActivity(android.content.Intent)
without
consuming it.
peekNextStartedActivity
in class ShadowContextWrapper
Intent
public android.content.Intent getNextStartedService()
Intent
started by startService(android.content.Intent)
and returns it.
getNextStartedService
in class ShadowContextWrapper
Intent
public android.content.Intent peekNextStartedService()
Intent
started by startService(android.content.Intent)
without
consuming it.
peekNextStartedService
in class ShadowContextWrapper
Intent
public com.xtremelabs.robolectric.res.ResourceLoader getResourceLoader()
ResourceLoader
getResourceLoader
in class ShadowContext
ResourceLoader
associated with this Application@Implementation public void sendBroadcast(android.content.Intent intent)
Intent
by iterating through the registered receivers, invoking their filters, and calling
onRecieve(Application, Intent)
as appropriate. Does not enqueue the Intent
for later inspection.
sendBroadcast
in class ShadowContextWrapper
intent
- the Intent
to broadcast
todo: enqueue the Intent for later inspection@Implementation public android.content.Intent registerReceiver(android.content.BroadcastReceiver receiver, android.content.IntentFilter filter)
null
registerReceiver
in class ShadowContextWrapper
null
@Implementation public void unregisterReceiver(android.content.BroadcastReceiver broadcastReceiver)
unregisterReceiver
in class ShadowContextWrapper
public void assertNoBroadcastListenersRegistered(android.content.Context context, java.lang.String type)
Application
and if any of them match the given
Context
object throws a RuntimeException
context
- the Context
to check for on each of the remaining registered receiverstype
- the type to report for the context if an exception is thrown
java.lang.RuntimeException
- if there are any recievers registered with the given Context
public java.util.List<ShadowApplication.Wrapper> getRegisteredReceivers()
ShadowApplication.Wrapper
s for registered receiverspublic android.view.LayoutInflater getLayoutInflater()
Application
public android.appwidget.AppWidgetManager getAppWidgetManager()
Application
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |