I have a list in a table fragment with delete button in each row.Whenever I tap to delete I am getting
java.lang.NullPointerException: Attempt to write to field 'int android.support.v4.app.Fragment.mNextAnim' on a null object reference
I have used this code example to reload the page. And I found that my fragment is null. I don't know how to resolve this issue. Also how to change it to support.v4.app
or simply FragmentManager
.
This is my code
Fragment frg = null;
frg = getFragmentManager().findFragmentById(R.id.table_fragment_container);
Log.v("frag",""+frg); //this is null
final FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.detach(frg);
ft.attach(frg);
ft.commit();