Skip to content

Instantly share code, notes, and snippets.

@eatgrass
Created September 21, 2015 10:00
Show Gist options
  • Save eatgrass/1ce38776aa09075cf4d3 to your computer and use it in GitHub Desktop.
Save eatgrass/1ce38776aa09075cf4d3 to your computer and use it in GitHub Desktop.
Roboguice 3 Integration
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foo.bar"
android:versionCode="1"
android:versionName="1.0" >
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="roboguice.modules"
android:value="com.foo.bar.module.ServiceModule" />
<!-- your activities goes here -->
...
</application>
</manifest>
package com.foo.bar.module;
import com.google.inject.AbstractModule;
import com.foo.bar.IService;
import com.foo.bar.ServiceFactory;
/**
* Created by Jonathan on 15/7/21.
*/
public class ServiceModule extends AbstractModule{
@Override
protected void configure() {
bind(IService.class).toInstance(ServiceFactory.getInstance().getService());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment