Start FragmentActivity from Activity

匿名 (未验证) 提交于 2019-12-03 08:46:08

问题:

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:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!