Created
September 21, 2015 10:00
-
-
Save eatgrass/1ce38776aa09075cf4d3 to your computer and use it in GitHub Desktop.
Roboguice 3 Integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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