Answer the question
In order to leave comments, you need to log in
Properly closing an activity with a fragment?
Hello.
I'm new to Android dev, so I apologize for a possibly stupid question. But the problem is this:
There are 2 activities:
@Override
protected void onPostResume() {
FragmentTransaction FragManager = getFragmentManager().beginTransaction();
FragManager.replace(R.id.frag_lay, new Fragment1());
FragManager.commit();
super.onPostResume();
Answer the question
In order to leave comments, you need to log in
In short, throw out the second activity. In 2k18 there is no need to do two. Everything must be done in fragments. The fragment that displays data from the database must monitor the state of the database and update the data. If you use SQLite, I recommend to fasten StorIO.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question