added route singleton

This commit is contained in:
Sem van der Hoeven
2021-01-06 10:48:03 +01:00
parent abc58d3606
commit f6af7ae80b
4 changed files with 46 additions and 18 deletions

View File

@@ -14,6 +14,8 @@ import android.widget.Toast;
import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.data.RouteHandler;
import com.a1.nextlocation.data.StaticData;
import com.a1.nextlocation.network.ApiHandler;
public class RouteDetailFragment extends Fragment {
@@ -45,6 +47,7 @@ public class RouteDetailFragment extends Fragment {
public void startRoute(View view) {
ApiHandler.INSTANCE.getDirections(route);
RouteHandler.INSTANCE.followRoute(route);
Toast.makeText(requireContext(),"Route started!",Toast.LENGTH_SHORT).show();
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).addToBackStack(null).commit();