AbstractActivity

search
Acharkit

AbstractActivity

The abstractActivity is subClass from the appCompatActivity.

For use The abstractActivity must be extend activity from this.

public class MainActivity extends AbstractActivity

getActivity

Return current instance from this activity

getActivity();

startActivity

Show other activity with intent

argument:
    Class class
startActivity(NextActivity.class);

getVisibleFragment()

Return current fragment (if exist fragment)

getVisibleFragment();

getFragmentList

Return list of fragment in backstack

getFragmentList();

findFragment

Find the fragment from backstack

argument:
    String tagId
findFragment("tagIdFragment");

hasBackStack

Check any fragment is exist in backstack

if (!hasBackStack()) {
    ....
}

clearBackStack

Clear any fragment from backstack

clearBackStack();

presentFragment

Show fragment instance in activity

argument:
    AbstractFragment fragment
    int container
    String tagId
    boolean addToBackStack
ExampleFragment exampleFragment = new ExampleFragment();
presentFragment(exampleFragment, R.id.frameLayout, "FRAGMENT_TAG_ID", true);