3
3
import android .content .Context ;
4
4
import android .content .Intent ;
5
5
import android .os .Bundle ;
6
- import android .preference .PreferenceActivity ;
7
6
import android .preference .PreferenceManager ;
8
7
import android .support .v7 .app .AppCompatDelegate ;
9
8
import android .view .MenuItem ;
10
9
10
+ import butterknife .BindView ;
11
+ import butterknife .ButterKnife ;
11
12
import fr .free .nrw .commons .R ;
13
+ import fr .free .nrw .commons .theme .NavigationBaseActivity ;
14
+
15
+ public class SettingsActivity extends NavigationBaseActivity {
16
+ private SettingsFragment settingsFragment ;
12
17
13
- public class SettingsActivity extends PreferenceActivity {
14
18
private AppCompatDelegate settingsDelegate ;
15
19
16
20
@ Override
@@ -22,11 +26,13 @@ protected void onCreate(Bundle savedInstanceState) {
22
26
setTheme (R .style .LightAppTheme );
23
27
}
24
28
25
- // Display the fragment as the main content.
26
- getFragmentManager ().beginTransaction ()
27
- .replace (android .R .id .content , new SettingsFragment ()).commit ();
29
+ settingsFragment = (SettingsFragment ) getFragmentManager ().findFragmentById (R .id .settingsFragment );
28
30
29
31
super .onCreate (savedInstanceState );
32
+ setContentView (R .layout .activity_settings );
33
+
34
+ ButterKnife .bind (this );
35
+ initDrawer ();
30
36
}
31
37
32
38
// Get an action bar
@@ -39,7 +45,7 @@ protected void onPostCreate(Bundle savedInstanceState) {
39
45
settingsDelegate .onPostCreate (savedInstanceState );
40
46
41
47
//Get an up button
42
- settingsDelegate .getSupportActionBar ().setDisplayHomeAsUpEnabled (true );
48
+ // settingsDelegate.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
43
49
}
44
50
45
51
//Handle action-bar clicks
0 commit comments