File tree Expand file tree Collapse file tree 5 files changed +18
-10
lines changed
app/src/main/java/com/donnfelker/android/bootstrap/ui Expand file tree Collapse file tree 5 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import com .actionbarsherlock .app .SherlockActivity ;
8
8
import com .actionbarsherlock .view .MenuItem ;
9
+ import com .donnfelker .android .bootstrap .BootstrapApplication ;
9
10
10
11
import butterknife .Views ;
11
12
@@ -18,6 +19,9 @@ public abstract class BootstrapActivity extends SherlockActivity {
18
19
public void setContentView (int layoutResId ) {
19
20
super .setContentView (layoutResId );
20
21
22
+
23
+ BootstrapApplication .getInstance ().inject (this );
24
+
21
25
// Used to inject views with the Butterknife library
22
26
Views .inject (this );
23
27
}
Original file line number Diff line number Diff line change 1
1
package com .donnfelker .android .bootstrap .ui ;
2
2
3
+ import android .os .Bundle ;
4
+
3
5
import com .actionbarsherlock .app .SherlockFragmentActivity ;
4
6
import com .donnfelker .android .bootstrap .BootstrapApplication ;
5
7
9
11
* Base class for all Bootstrap Activities that need fragments.
10
12
*/
11
13
public class BootstrapFragmentActivity extends SherlockFragmentActivity {
14
+ @ Override
15
+ protected void onCreate (Bundle savedInstanceState ) {
16
+ super .onCreate (savedInstanceState );
17
+
18
+ BootstrapApplication .getInstance ().inject (this );
19
+ }
20
+
21
+ @ Override
22
+ public void setContentView (int layoutResId ) {
23
+ super .setContentView (layoutResId );
12
24
13
- // Handle any super class related items here.
25
+ Views .inject (this );
26
+ }
14
27
15
28
}
Original file line number Diff line number Diff line change @@ -39,10 +39,6 @@ protected void onCreate(Bundle savedInstanceState) {
39
39
40
40
setContentView (R .layout .bootstrap_timer );
41
41
42
- BootstrapApplication .getInstance ().inject (this );
43
-
44
- Views .inject (this );
45
-
46
42
setTitle (R .string .timer );
47
43
48
44
start .setOnClickListener (this );
Original file line number Diff line number Diff line change @@ -36,9 +36,6 @@ protected void onCreate(Bundle savedInstanceState) {
36
36
super .onCreate (savedInstanceState );
37
37
setContentView (R .layout .carousel_view );
38
38
39
- Views .inject (this );
40
- BootstrapApplication .getInstance ().inject (this );
41
-
42
39
pager .setAdapter (new BootstrapPagerAdapter (getResources (), getSupportFragmentManager ()));
43
40
44
41
indicator .setViewPager (pager );
Original file line number Diff line number Diff line change @@ -29,8 +29,6 @@ protected void onCreate(Bundle savedInstanceState) {
29
29
30
30
setContentView (R .layout .user_view );
31
31
32
- BootstrapApplication .getInstance ().inject (this );
33
-
34
32
if (getIntent () != null && getIntent ().getExtras () != null ) {
35
33
user = (User ) getIntent ().getExtras ().getSerializable (USER );
36
34
}
You can’t perform that action at this time.
0 commit comments