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}: java.lang.UnsupportedOperationException: internal error, how did you get here?
Here is the relevant code:
public class DeviceActivity extends SherlockActivity {
RelativeLayout layout;
Device currentDevice;
ArrayList<User> assigneesList;
ProgressDialog progressDialog;
@Inject
DevicesHelpers devicesHelpers;
@Inject
DevicesData devicesData;
@Inject
UsersData usersData;
@InjectView(R.id.device_model)
TextView deviceModel;
@InjectView(R.id.name)
TextView name;
@InjectView(R.id.os)
TextView os;
@InjectView(R.id.version)
TextView version;
@InjectView(R.id.serial_number)
TextView serialNumber;
@InjectView(R.id.assign_to_me)
Button assignToMeButton;
@InjectView(R.id.owner_photo)
ImageView ownerPhoto;
@InjectView(R.id.owner_info)
RelativeLayout ownerInfo;
@InjectView(R.id.owner_name)
TextView ownerName;
@InjectView(R.id.owner_email)
TextView ownerEmail;
@InjectView(R.id.device_not_assigned)
TextView deviceNotAssigned;
@InjectView(R.id.device_assigned_to_you)
TextView deviceAssignedToYou;
@InjectView(R.id.assignee_selection)
LinearLayout assigneeSelection;
@InjectView(R.id.assign_to_other)
Button assignToOtherButton;
@InjectView(R.id.assignee_selector)
AutoCompleteTextView assigneeSelector;
User currentAssignee;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_device);
//RoboGuice.injectMembers(this.getApplication(), this);
//RoboGuice.getInjector(getApplicationContext()).injectMembersWithoutViews(this);
RoboGuice.getInjector(getApplicationContext()).injectViewMembers(this);
}
}
Also, I tried
RoboGuice.injectMembers(getApplicationContext(), this);
but it seems to only inject all but the Views
I'm using RoboGuice 2.0 (roboguice-2.0.jar, guice-3.0-no_aop.jar).
Android SDK is 4.1.2
I didn't have any problems injecting views inside Fragments.
Thanks
Pablo