タブを使用しようとしましたが、PagerAdapter
はタブレイアウトを作成しようとしています。ビューにアクセスする際のフラグメントエラー
I持って私のFragment
に次の式:次のエラーで
cpPrecTextView = (BootstrapLabel) getView().findViewById(R.id.cpPrec);
cpPrecTextView.setText(cpPrecTextView.getText() + cpPrec);
マイアプリのクラッシュ:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
at com.pgoiv.pokemongoiv.TabFragment1.onCreateView(TabFragment1.java:45)
何が悪いのでしょうか?
は、 'getView()'がnullであることを示します。 –