I have a LoginActivity which extends AccountAuthenticatorActivity. This activity has several fragments which are androidx.fragment.app.Fragments. The Problem is from fragments I can't call:
((LoginActivity) getActivity()).setAccountAuthenticatorResult(intent.getExtras());
Because LoginActivity extends AccountAuthenticatorActivity which extends android.app.activity but getActivity() returns androidx.fragment.app.FragmentActivity which can't be cast to my LoginActivity. If I use android.app.Fragment I can't use methods like getViewLifecycleOwner() of androidx Fragment. So what's the solution here?
Update:
Although delegation pattern could solve this problem, this question has an interesting answer here: