proper context
This commit is contained in:
@@ -54,8 +54,7 @@ public class RouteDetailFragment extends Fragment {
|
|||||||
|
|
||||||
//Sets the image of the RouteDetail
|
//Sets the image of the RouteDetail
|
||||||
ImageView imageView = view.findViewById(R.id.route_detail_image);
|
ImageView imageView = view.findViewById(R.id.route_detail_image);
|
||||||
Context context = imageView.getContext();
|
int id = requireContext().getResources().getIdentifier(this.route.getImageURL(), "drawable", requireContext().getPackageName());
|
||||||
int id = context.getResources().getIdentifier(this.route.getImageURL(), "drawable", context.getPackageName());
|
|
||||||
imageView.setImageResource(id);
|
imageView.setImageResource(id);
|
||||||
|
|
||||||
TextView routeName = view.findViewById(R.id.route_title);
|
TextView routeName = view.findViewById(R.id.route_title);
|
||||||
|
|||||||
Reference in New Issue
Block a user