made list managers load on mainactivity oncreate
This commit is contained in:
@@ -32,8 +32,11 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
bottomNav.setOnNavigationItemSelectedListener(navListener);
|
bottomNav.setOnNavigationItemSelectedListener(navListener);
|
||||||
|
|
||||||
LocationListManager.INSTANCE.setContext(this);
|
LocationListManager.INSTANCE.setContext(this);
|
||||||
|
LocationListManager.INSTANCE.load();
|
||||||
CouponListManager.INSTANCE.setContext(this);
|
CouponListManager.INSTANCE.setContext(this);
|
||||||
|
CouponListManager.INSTANCE.load();
|
||||||
RouteListManager.INSTANCE.setContext(this);
|
RouteListManager.INSTANCE.setContext(this);
|
||||||
|
RouteListManager.INSTANCE.load();
|
||||||
|
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,8 +100,6 @@ public class HomeFragment extends Fragment {
|
|||||||
// add location manager and set the start point
|
// add location manager and set the start point
|
||||||
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
|
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
|
||||||
LocationListManager.INSTANCE.load();
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
||||||
|
|||||||
Reference in New Issue
Block a user