com.xtremelabs.robolectric.shadows
Class ShadowContextWrapper

java.lang.Object
  extended by com.xtremelabs.robolectric.shadows.ShadowContext
      extended by com.xtremelabs.robolectric.shadows.ShadowContextWrapper
Direct Known Subclasses:
ShadowActivity, ShadowApplication, ShadowContextThemeWrapper, ShadowService

@Implements(value=android.content.ContextWrapper.class)
public class ShadowContextWrapper
extends ShadowContext


Constructor Summary
ShadowContextWrapper()
           
 
Method Summary
 void __constructor__(android.content.Context baseContext)
           
 android.content.Context getApplicationContext()
           
 android.content.ContentResolver getContentResolver()
           
 android.content.Intent getNextStartedActivity()
          Non-Android accessor that delegates to the application to consume and return the next Intent on the started activities stack.
 android.content.Intent getNextStartedService()
          Non-Android accessor that delegates to the application to consume and return the next Intent on the started services stack.
 android.content.pm.PackageManager getPackageManager()
          Implements Android's MockPackageManager with an anonymous inner class.
 java.lang.String getPackageName()
           
 android.content.res.Resources getResources()
           
 android.content.SharedPreferences getSharedPreferences(java.lang.String name, int mode)
           
 java.lang.Object getSystemService(java.lang.String name)
           
 android.content.Intent peekNextStartedActivity()
          Non-Androic accessor that delegates to the application to return (without consuming) the next Intent on the started activities stack.
 android.content.Intent peekNextStartedService()
          Non-Android accessor that delegates to the application to return (without consuming) the next Intent on the started services stack.
 android.content.Intent registerReceiver(android.content.BroadcastReceiver receiver, android.content.IntentFilter filter)
           
 void sendBroadcast(android.content.Intent intent)
           
 void startActivity(android.content.Intent intent)
           
 android.content.ComponentName startService(android.content.Intent service)
           
 void unregisterReceiver(android.content.BroadcastReceiver broadcastReceiver)
           
 
Methods inherited from class com.xtremelabs.robolectric.shadows.ShadowContext
getResourceLoader, getString, getString, getText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowContextWrapper

public ShadowContextWrapper()
Method Detail

__constructor__

public void __constructor__(android.content.Context baseContext)

getApplicationContext

@Implementation
public android.content.Context getApplicationContext()

getResources

@Implementation
public android.content.res.Resources getResources()

getContentResolver

@Implementation
public android.content.ContentResolver getContentResolver()

getSystemService

@Implementation
public java.lang.Object getSystemService(java.lang.String name)

sendBroadcast

@Implementation
public void sendBroadcast(android.content.Intent intent)

registerReceiver

@Implementation
public android.content.Intent registerReceiver(android.content.BroadcastReceiver receiver,
                                                              android.content.IntentFilter filter)

unregisterReceiver

@Implementation
public void unregisterReceiver(android.content.BroadcastReceiver broadcastReceiver)

getPackageName

@Implementation
public java.lang.String getPackageName()

getPackageManager

@Implementation
public android.content.pm.PackageManager getPackageManager()
Implements Android's MockPackageManager with an anonymous inner class.

Returns:
a MockPackageManager

startService

@Implementation
public android.content.ComponentName startService(android.content.Intent service)

startActivity

@Implementation
public void startActivity(android.content.Intent intent)

getSharedPreferences

@Implementation
public android.content.SharedPreferences getSharedPreferences(java.lang.String name,
                                                                             int mode)

getNextStartedActivity

public android.content.Intent getNextStartedActivity()
Non-Android accessor that delegates to the application to consume and return the next Intent on the started activities stack.

Returns:
the next started Intent for an activity

peekNextStartedActivity

public android.content.Intent peekNextStartedActivity()
Non-Androic accessor that delegates to the application to return (without consuming) the next Intent on the started activities stack.

Returns:
the next started Intent for an activity

getNextStartedService

public android.content.Intent getNextStartedService()
Non-Android accessor that delegates to the application to consume and return the next Intent on the started services stack.

Returns:
the next started Intent for a service

peekNextStartedService

public android.content.Intent peekNextStartedService()
Non-Android accessor that delegates to the application to return (without consuming) the next Intent on the started services stack.

Returns:
the next started Intent for a service