|
6 | 6 | import android.preference.Preference; |
7 | 7 | import android.preference.PreferenceFragment; |
8 | 8 |
|
| 9 | +import androidx.annotation.Nullable; |
| 10 | + |
9 | 11 | import com.blogspot.e_kanivets.moneytracker.BuildConfig; |
10 | 12 | import com.blogspot.e_kanivets.moneytracker.MtApp; |
11 | 13 | import com.blogspot.e_kanivets.moneytracker.R; |
|
14 | 16 | import com.blogspot.e_kanivets.moneytracker.controller.PreferenceController; |
15 | 17 | import com.blogspot.e_kanivets.moneytracker.controller.data.AccountController; |
16 | 18 | import com.blogspot.e_kanivets.moneytracker.controller.CurrencyController; |
| 19 | +import com.blogspot.e_kanivets.moneytracker.databinding.ActivitySettingsBinding; |
17 | 20 | import com.blogspot.e_kanivets.moneytracker.entity.data.Account; |
18 | 21 |
|
19 | 22 | import java.util.ArrayList; |
|
24 | 27 | public class SettingsActivity extends BaseBackActivity { |
25 | 28 | @SuppressWarnings("unused") private static final String TAG = "SettingsActivity"; |
26 | 29 |
|
27 | | - @Override protected int getContentViewId() { |
28 | | - return R.layout.activity_settings; |
29 | | - } |
| 30 | + private ActivitySettingsBinding binding; |
| 31 | + |
| 32 | + @Override |
| 33 | + protected void onCreate(@Nullable Bundle savedInstanceState) { |
| 34 | + super.onCreate(savedInstanceState); |
30 | 35 |
|
31 | | - @Override protected void initViews() { |
32 | | - super.initViews(); |
| 36 | + binding = ActivitySettingsBinding.inflate(getLayoutInflater()); |
| 37 | + setContentView(binding.getRoot()); |
| 38 | + |
| 39 | + initToolbar(); |
| 40 | + initViews(); |
| 41 | + } |
33 | 42 |
|
| 43 | + private void initViews() { |
34 | 44 | // Display the fragment as the main content. |
35 | | - getFragmentManager().beginTransaction().replace(R.id.contentView, new SettingsFragment()).commit(); |
| 45 | + getFragmentManager().beginTransaction().replace(binding.contentView.getId(), new SettingsFragment()).commit(); |
36 | 46 | } |
37 | 47 |
|
38 | 48 | public static class SettingsFragment extends PreferenceFragment { |
|
0 commit comments