私のアプリケーションでgetChildFragmentManager()を使用していますが、これをフラグメントOncreateView()内のコードの下に呼び出したいと思います。コード、行番号2にエラーがありますか?OnCreateView()内のSupportPlaceAutocompleteFragmentを呼び出す方法
1. SupportPlaceAutocompleteFragment autocompleteFragment = (SupportPlaceAutocompleteFragment) getFragmentManager()
2. .findFragmentById(R.id.place_autocomplete_fragment);
3. autocompleteFragment.setOnPlaceSelectedListener(this);
4. autocompleteFragment.setHint("Select a Location");
ERROR:のjava.lang.NullPointerException:仮想メソッド「空com.google.android.gms.location.places.ui.SupportPlaceAutocompleteFragment.setOnPlaceSelectedListenerを起動しようと(com.google.android.gms nullオブジェクト参照 com.example.sample.fragments.LocationFragment.onCreateView上.location.places.ui.PlaceSelectionListener)」(LocationFragment.java:2)あなたがSupportPlaceAutocompleteFragment
あなたのアクティビティを使用している
at