Route displays name
This commit is contained in:
@@ -7,11 +7,16 @@ import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
|
||||
public class RouteDetailFragment extends Fragment {
|
||||
|
||||
private Route route;
|
||||
private TextView routeDetailText;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -19,9 +24,16 @@ public class RouteDetailFragment extends Fragment {
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_route_detail, container, false);
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_route_detail, container, false);
|
||||
if(getArguments().getParcelable("route") != null) {
|
||||
this.route = getArguments().getParcelable("route");
|
||||
}
|
||||
|
||||
this.routeDetailText = view.findViewById(R.id.routeDetailText);
|
||||
this.routeDetailText.setText(this.route.getName());
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user