MarkerDetailActivity: set title.
package com.google.android.apps.mytracks.fragments;
+import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.net.Uri;
@@ -121,10 +122,11 @@ public class MarkerDetailFragment extends Fragment {
}
@Override
- public View onCreateView(
- LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.marker_detail_fragment, container, false);
+ getActivity().setTitle(getArguments().getString(KEY_TITLE));
+
photo = view.findViewById(R.id.marker_detail_waypoint_photo);
textGradient = view.findViewById(R.id.marker_detail_waypoint_text_gradient);
waypointInfo = view.findViewById(R.id.marker_detail_waypoint_info);
@@ -159,14 +161,6 @@ public class MarkerDetailFragment extends Fragment {
handler.removeCallbacks(hideText);
}
- @Override
- public void setUserVisibleHint(boolean isVisibleToUser) {
- super.setUserVisibleHint(isVisibleToUser);
- if (isVisibleToUser) {
- getActivity().setTitle(getArguments().getString(KEY_TITLE));
- }
- }
-
@Override
public void setMenuVisibility(boolean menuVisible) {
super.setMenuVisibility(menuVisible);
