Thursday 15 August 2013

java - Roboguice causing strange exceptions -



java - Roboguice causing strange exceptions -

in add-on former question, hasn't been answered yet, i'm still having lot of problems getting roboguice , running. primary goal create simple activity navigation drawer using separate fragment roboguice, nil works @ all.

what tried:

roboguice version 2.0 roboguice version 3.0b-experimental android w/ , without back upwards libraries

example code:

public class mainactivity extends roboactivity { @injectfragment private navigationdrawerfragment _navigationdrawerfragment; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); _navigationdrawerfragment.init(); } } public class navigationdrawerfragment extends robofragment {}

i tried several things, including using standard fragment both back upwards library , default android sdk , implementing injection methods myself deriving robofragment , not.

errors include:

nullpointerexception -> roboguice doesn't inject anything. _navigationdrawerfragment null type exceptions -> roboguice tells me class doesn't derive fragment etc.

are there examples has succesfully used roboguice navigation drawer (android sdk, not sherlock)?

java android android-activity android-fragments dependency-injection

No comments:

Post a Comment