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
5
votes
2 answers

Problem with ProGuard and RoboGuice with @Inject annotations

I'm having some problems with proguard when optimizing my android app. It seems that there is something done to an annotation class (@com.google.inject.Inject) which Dalvik/Harmony is not happy with at…
Mark Renouf
  • 30,697
  • 19
  • 94
  • 123
5
votes
3 answers

Injected objects became null after upgrading to Roboguice 3

I've just upgraded our project to use Roboguice 3 and all of a sudden all the injected objects became null, that includes POJO, Providers, Views, Resources etc. And I'm struggling to figure out why. First of all there's the gradle build file, tried…
5
votes
2 answers

Android: How to extends my Activity class with RoboActivity + ActionBarActivity

I would like to use RoboActivity with my activity, but I don't know how to do that coz my current activity extends already ActionBarActivity: public class MainActivity extends ActionBarActivity Thank you so much
anthony
  • 7,653
  • 8
  • 49
  • 101
5
votes
1 answer

roboguice how to inject custom class

hi i am currently using roboguice as we know, we can use annotation to get class injected such as @InjectView(R.id.list)ListView x the @inject notation works, because i extend from RoboActivity, or any Robo class my question is if i want to inject…
user1233587
  • 2,033
  • 4
  • 24
  • 24
5
votes
2 answers

RoboGuice unit test injecting app module instead of test module

I am trying to write a JUnit test for an Android Service using RoboGuice 2.0. I have a test module that binds injected dependencies to Mockito mock objects. However, when I run the test, the real implementations from my app module get injected…
svattom
  • 320
  • 3
  • 12
5
votes
1 answer

When are @InjectView fields injected?

Exactly when are an Activity's fields that are annotated with @InjectView or @InjectResource injected?
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
4
votes
1 answer

onViewCreated with compatibility library

In an Android application I have a fragment implemented that overrides onViewCreated to set up some OnClickListeners once the view is there. This all works fine when I implement. However as soon as I add the compatibility library v4 r3 it seems…
Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
4
votes
2 answers

using roboguice without extending Activity

Is there a way to use roboguice without extending Activity class with RoboActivity.
Vaibhav Mishra
  • 11,384
  • 12
  • 45
  • 58
4
votes
3 answers

Activity interceptor

Is there any way in android to intercept activity method calls (just the standart ones, like "onStart. onCreate")? I have a lot of functionality that must be present in every activity in my app, and (since it uses different types of activities…
Alex Orlov
  • 18,077
  • 7
  • 55
  • 44
4
votes
2 answers

How to inject a dialog view using Roboguice?

It seems that roboguice can only inject views from the contentView defined in onCreate(...) of the activity. Outside onCreate(), for example, if I have my custom dialog, which has also a content view (e.g.…
Mellon
  • 37,586
  • 78
  • 186
  • 264
4
votes
0 answers

Robolectric junit test - missing internet permission

I am developing some JUnit test for ma app. I need to use Robolectric + Roboguice libraries. What I am trying to do now is only simple test which checks if activity is not null. Here is my code:…
Damian
  • 41
  • 5
4
votes
0 answers

Roboguice: using manual injections causes ConfigurationException (no implementation was bound)

I've found an issue with Roboguice when using manual instance resolution. It works once I turn off the Annotation Database. Otherwise I get the exception: No implementation for com.kmsoftware.roboguicetest.SomeInterface was bound. Am I doing…
kmalmur
  • 2,809
  • 3
  • 29
  • 37
4
votes
3 answers

Cant inject null value into class

I have a fragment that I want to reuse. Its functionality is the same, only the layout changes I am using roboguice to inject views by id into the variables I added this view for example: @Nullable @InjectView(R.id.edtEventLocationAddress) private…
Lena Bru
  • 13,521
  • 11
  • 61
  • 126
4
votes
1 answer

Maven + RoboGuice + ActionBarSherlock + RoboGuice-Sherlock

I am trying to create an Android base project using android-quickstart archetype, and adding RoboGuice, ActionBarSherlock dependencies, plus RoboGuice-Sherlock to combine the two. This is my pom.xml:
M Rajoy
  • 4,028
  • 14
  • 54
  • 111
4
votes
2 answers

Robolectric 2.0 not creating views when testing

I'm trying to set up testing with robolectric and roboguice. I'm successfully injecting and testing classes but when i try to test activities i can't seem to create View objects in the test environment I get the following…
David
  • 10,418
  • 17
  • 72
  • 122
1 2
3
21 22