Skip to content

Instantly share code, notes, and snippets.

@Axxiss
Last active December 14, 2015 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Axxiss/5126120 to your computer and use it in GitHub Desktop.
Save Axxiss/5126120 to your computer and use it in GitHub Desktop.
Module for system services injection
@Module(
entryPoints = {
MyApplication.class,
}
)
public class ServiceModule {
private Context mContext;
public ServiceModule(Context context) {
mContext = context;
}
@Provides @Singleton
TelephonyManager provideTelephonyManager(){
return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment