title: Street View Fragment black screen
body: <p>I am trying to to insert a Street View fragment inside an Activity but I receive only a black screen, without error.</p>
  
  <p>This is my Activity:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.fennec.streetviewtest.MainActivity"&gt;
  
      &lt;FrameLayout
          android:id="@+id/frameLayoutTest"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
      &lt;/FrameLayout&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>This is my fragment:</p>
  
  <pre><code>&lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:map="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/streetviewpanorama"
      android:name="com.google.android.gms.maps.SupportStreetViewPanoramaFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.fennec.streetviewtest.StreetViewFragment" /&gt;
  </code></pre>
  
  <p>This is my MainActivity java class:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements StreetViewFragment.OnFragmentInteractionListener {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Fragment fragment=new StreetViewFragment();
          FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
          ft.replace(R.id.frameLayoutTest,fragment).commit();
      }
      @Override
      public void onFragmentInteraction(Uri uri) {
      }
  }
  </code></pre>
  
  <p>And this is my StreetViewFragment java class:</p>
  
  <pre><code>public class StreetViewFragment extends Fragment implements OnStreetViewPanoramaReadyCallback {
      private static final String ARG_PARAM1 = "param1";
      private static final String ARG_PARAM2 = "param2";
  
      private String mParam1;
      private String mParam2;
  
      private OnFragmentInteractionListener mListener;
  
      public StreetViewFragment() {
      }
  
      public static StreetViewFragment newInstance(String param1, String param2) {
          StreetViewFragment fragment = new StreetViewFragment();
          Bundle args = new Bundle();
          args.putString(ARG_PARAM1, param1);
          args.putString(ARG_PARAM2, param2);
          fragment.setArguments(args);
          return fragment;
      }
  
      StreetViewPanorama mStreetViewPanorama;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          if (getArguments() != null) {
              mParam1 = getArguments().getString(ARG_PARAM1);
              mParam2 = getArguments().getString(ARG_PARAM2);
          }
  
          FragmentManager fm = getChildFragmentManager();
          SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
                  (SupportStreetViewPanoramaFragment) getFragmentManager()
                          .findFragmentById(R.id.streetviewpanorama);
          if (streetViewPanoramaFragment == null) {
              streetViewPanoramaFragment = streetViewPanoramaFragment.newInstance();
              fm.beginTransaction().replace(R.id.streetviewpanorama, streetViewPanoramaFragment).commit();
          }
          streetViewPanoramaFragment.getStreetViewPanoramaAsync(StreetViewFragment.this);
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_street_view, container, false);
      }
  
      public void onButtonPressed(Uri uri) {
          if (mListener != null) {
              mListener.onFragmentInteraction(uri);
          }
      }
  
      @Override
      public void onAttach(Context context) {
          super.onAttach(context);
          if (context instanceof OnFragmentInteractionListener) {
              mListener = (OnFragmentInteractionListener) context;
          } else {
              throw new RuntimeException(context.toString()
                      + " must implement OnFragmentInteractionListener");
          }
      }
  
      @Override
      public void onDetach() {
          super.onDetach();
          mListener = null;
      }
  
      @Override
      public void onStreetViewPanoramaReady(StreetViewPanorama streetViewPanorama) {
          streetViewPanorama.setPosition(new LatLng(-33.87365, 151.20689));
  
      }
  
      public interface OnFragmentInteractionListener {
          // TODO: Update argument type and name
          void onFragmentInteraction(Uri uri);
      }
  }
  </code></pre>
  
  <p>The same app works fine if I insert the fragment and the java code directly inside the Activity. Where is the error? How i can see StreetView in this case???</p>
  
  <p>Thanks.</p>