use of com.omkarmoghe.pokemap.views.map.MapWrapperFragment in project Pokemap by omkarmoghe.
the class MainActivity method onCreate.
//region Lifecycle Methods
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sharedPref = this.getSharedPreferences(getString(R.string.pref_file_key), Context.MODE_PRIVATE);
themeId = sharedPref.getInt(getString(R.string.pref_theme_no_action_bar), R.style.AppTheme_NoActionBar);
setTheme(themeId);
setContentView(R.layout.activity_main);
pref = new PokemapSharedPreferences(this);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FragmentManager fragmentManager = getSupportFragmentManager();
MapWrapperFragment mapWrapperFragment = (MapWrapperFragment) fragmentManager.findFragmentByTag(MAP_FRAGMENT_TAG);
if (mapWrapperFragment == null) {
mapWrapperFragment = MapWrapperFragment.newInstance();
}
fragmentManager.beginTransaction().replace(R.id.main_container, mapWrapperFragment, MAP_FRAGMENT_TAG).commit();
if (pref.isServiceEnabled()) {
startNotificationService();
}
}
Aggregations