{"action":"closed","issue":{"number":139,"created_at":"2011-09-12T02:30:58Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I've tested this in 0.9.4, 1.0-RC4, 1.0-RC5 and 1.5-SNAPSHOT, RobolectricClassLoader load android.content.ServiceConnection properly in 0.9.4 but not in 1.0-RC4, 1.0-RC5 and 1.5-SNAPSHOT. \r\n\r\nMy activity class looks like this: \r\npublic class SampleActivity extends Activity { \r\n  protected SampleServiceBinder serviceBinder; \r\n  protected ServiceConnection serviceConnection = new ServiceConnection() { \r\n    public void onServiceConnected(ComponentName className, IBinder service) { \r\n      serviceBinder = (SampleServiceBinder) service; \r\n    } \r\n    public void onServiceDisconnected(ComponentName className) { \r\n      if (serviceBinder != null) { \r\n        serviceBinder = null; \r\n      } \r\n    } \r\n  }; \r\n  public void onCreate(Bundle savedInstanceState) { \r\n    super.onCreate(savedInstanceState); \r\n    bindService(new Intent(this, SampleService.class), \r\n       serviceConnection, Context.BIND_AUTO_CREATE); \r\n  } \r\n} \r\n\r\nMy simple activity test: \r\n@RunWith(RobolectricTestRunner.class) \r\npublic class LiveTVControlActivityTest { \r\n  private SampleActivity sampleActivity; \r\n  @Before \r\n  public void setUp() throws Exception { \r\n    sampleActivity = new sampleActivity(); // add break point here and debug \r\n    assertNotNull(sampleActivity); \r\n    sampleActivity.onCreate(null); \r\n  } \r\n} \r\n\r\nI've debugged step by step at break point, in 1.0-RC4 and 1.0-RC5, the \r\nServiceConnection implemented in my SampleActivity is ignored by \r\nRobolectricClassLoader, so at later stage in SampleActivity where use \r\nserviceBinder.doSomething(), I've got a null pointer exception. The same\r\ntest cod works in 0.9.4\r\n","comments":1,"title":"RobolectricClassLoader not load android.content.ServiceConnection in 1.0-RC4","updated_at":"2011-10-18T22:54:28Z","url":"https://api.github.com/repos/pivotal/robolectric/issues/139","id":1620660,"assignee":null,"milestone":null,"closed_at":"2011-10-18T22:54:28Z","user":{"gravatar_id":"cac178ad32ea3fba1f594303b778010e","avatar_url":"https://secure.gravatar.com/avatar/cac178ad32ea3fba1f594303b778010e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/yorkw","id":950899,"login":"yorkw"},"html_url":"https://github.com/pivotal/robolectric/issues/139","labels":[],"state":"closed"},"legacy":{"number":139,"action":"closed","issue":1620660}}