Hello. The main activity contains a ViewPager, in which 3 fragments can be scrolled.

I need to launch a new activity from a fragment, but I don’t know how to do it. I created an intent in Main and a context (Context c = this;), through a function (I wrote separately) passed into the fragment, and there I launched a new activity when I clicked a button, but the application closes.

  • Thanks, solved the problem. - antoncti
  • write a request to google much faster than write a question here google.com.ua/… - Vladyslav Matviienko

1 answer 1

 startActivity(new Intent(getActivity(), NewActivity.class));