6

How can I start a FragmentActivity from an Activity?

My MainActivity is a splash screen and I want to star a FragmentActivity next.

I need something instead of, for example:

    startActivity(new Intent("com.example.manager.MyFragmentActivity"));

TIA.

1 Answers1

14

From your first Activity call:

  startActivity(new Intent(this, MyFragmentActivity.class));

Note: Make sure to register your MyFragmentActivity in your AndroidManifest.xml.

Edit: This training article on Starting Another Activity should be helpful to you.

twaddington
  • 11,607
  • 5
  • 35
  • 46
  • I tried to do the same, in android studio my fragment is not displayed in the auto-complete options. Also, on adding it without the auto-complete option, its showing an error that it is not assignable. What do I do? – praxmon Jan 28 '15 at 13:39