次のコードを使用して別の Fragment 内にある a を開こうとしていますFragment
が、原因のない Null Pointer Exception が発生します。
Fragment newFragment = new SecondFragment();
// consider using Java coding conventions (upper char class names!!!)
FragmentTransaction transaction = getFragmentManager().beginTransaction();
// Replace whatever is in the fragment_container view with this fragment,
// and add the transaction to the back stack
transaction.replace(R.id.menuitem_detail_container, newFragment);
transaction.addToBackStack(null);
// Commit the transaction
transaction.commit();
このコードはFragment ( )onItemClickListener
内のメソッド内の基本内にあります。onCreateView
android.support.v4.app.Fragment
私が間違っているかもしれないことについてのアイデアはありますか?