I have an ActionBarDrawerToggle which contains many fragments for example
RootFragment LoginFragment RegistrationFragment
from RootFragment i navigate to another activity like
Intent activity = new Intent(getActivity().getApplicationContext(),TestActivity.class);
activity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(activity);
getActivity().finish();
how to navigate from TestActivity to LoginFragment
i'm using the following code for example:
startActivity(new Intent(TestActivity.this, RegistrationFragment.class));
finish();
and the app crashes with the following message RegistrationFragment cannot be cast to android.app.Activity
Any help?