Questions tagged [roboguice]

Roboguice brings the power and testability of using the Google Guice dependency injection framework to Android application development.

RoboGuice is a framework that brings the simplicity and ease of Dependency Injection to Android, using Google's own Guice library.

Useful links

329 questions
0
votes
1 answer

Android - Roboguice and Robolectric injecting activity members?

I am running JUnit tests using Robolectric. I am trying to test an Activity that has injected members. I am able to get my test class to Inject its own member correctly. But Still can't inject mocks into my Activity members. I tried @Inject…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
0
votes
1 answer

Android & RoboGuice - Property injection inside a service?

I have an intent service, and I need to inject properties in this class. Right now RoboGuice doesn't inject them, and the properties are always null. My workaround is to have 2 static variables on my IntentService, and on Application load I get the…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
0
votes
1 answer

How to use Roboguice to inject subclasses?

Documentation on this is hard to come by. This is an advance use of Roboguice involving libraries. Say I have a class in my base library called MyRoboActivity which extends from RoboActivity @Inject HumanModel humanModel; In one project for men…
Mark Lapasa
  • 1,644
  • 4
  • 19
  • 37
0
votes
3 answers

How to use Google Guice to inject a dependancy

I've gone through the user guide and everything but yet I still don't understand exactly how to modify existing code to use Google Guice when trying to inject dependencies. So to make it easier I created this simple example and if someone could…
0
votes
1 answer

how to inject custom arrayadapter into fragment using roboguice 2.0

I have a fragment that contains a listView. The fragment extends roboFragment. The listView has a custom adapter that sets up different UI elements in the getView method. I want to use @InjectView to get the ui elements. I understand that in order…
U-L
  • 2,671
  • 8
  • 35
  • 50
0
votes
1 answer

When class injected by RoboGuice @Inject could be null?

When roboguice's @Inject could be null? I have class: @Singleton public class MyClass extends AnotherClass{ ... In many places I'm using @Inject private MyClass mMyClass; and it is working correctly. Recently I wrote simple class handling events…
Ari
  • 3,101
  • 2
  • 27
  • 49
0
votes
1 answer

COnstructor Injection with roboguice enters inifinite loop

HI I come from a background C#/.NET and have learned to work with a bit of Android.Now I am wana start to build a small app for fun and I tought to learn an IoC framework.After a bit of googeling I found roboguice.But I can not figure out how to…
aleczandru
  • 5,319
  • 15
  • 62
  • 112
0
votes
1 answer

RoboGuice injection of POJOs into POJOs

My Guice is a little rusty (been 3 years) so bear with me. I have a custom API (@ContextSingleton) object that I need to @Inject into my various classes. This works fine when the target class extends from RoboActivity (or in my case,…
ebernie
  • 820
  • 1
  • 8
  • 13
0
votes
1 answer

InjectView in an Activity read as a parameter

I've a helper class with one function, that receives an activity as a parameter. I want to inject a view from that activity. Is this possible? public class myClass { public void myMethod(final Activity activity) { // Use here a TextView…
nano
  • 2,511
  • 4
  • 25
  • 42
0
votes
0 answers

Guice Multibindings and proguard

Im trying to use roboguice+guice multibindings for android. When I skip proguard the app is working well. When proguard is on I got runtime errors like: Multibinder is not initialized The proguard.properties is set up correctly for the standard…
jakk
  • 1,193
  • 2
  • 12
  • 28
0
votes
1 answer

roboguice get currenty activity context

How do i inject the current Activity context into my object? I've tried using the @Inject annotation when declaring the instance variable as well as in the constructor of the object but it seems RoboGuice is injecting the wrong one or creating a new…
David
  • 10,418
  • 17
  • 72
  • 122
0
votes
1 answer

NullPointerException in Roboguice.setBaseApplicationInjector in JUnit Test

I am having a problem related to Roboguice and JUNIT. Actually I am doing a very little test to make it run, code: import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import…
Nicolas Jafelle
  • 2,661
  • 2
  • 24
  • 30
0
votes
1 answer

Error injecting activity views with RoboGuice 2 using

I'm having an issue injecting views with injectViewMembers, the error I get is this: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rgainternalapps.devicemanager/com.rgainternalapps.devicemanager.DeviceActivity}:…
Pablo
  • 1
0
votes
2 answers

What is wrong with RoboGuice

I want to create a singleton object using RoboGuice but I get null exception. I don't know what is wrong with my codes. @Singleton public class SessionService { private static Session session; public Session getSession()…
nesimtunc
  • 849
  • 7
  • 28
0
votes
1 answer

RoboAsyncTask custom loading animation

I have extended RoboAsyncTask implemented all needed methods, but while data loading it's displaying default loading animation. I have made my custom loading dialog but default loading animation on fragment still displaying. It is possible to remove…