我可以在 TabHost 下进行活动而不成为这些选项卡的一部分吗
换句话说,假设我有一组选项卡“活动 1”、“活动 2”和“活动 3”,它们都有自己的选项卡,但“活动 2”链接到“活动 4”(活动 4 没有自己的选项卡),但我仍然希望这些选项卡出现在 Activity 4 的标题中,因此用户可以轻松导航回原来的位置。有人可以帮我指出实现这一目标的方向吗?
Intent createNote = new Intent(RecipeNotesActivity.this, CreateNoteActivity.class);
startActivity(createNote);
In other words, say I have a group of tabs Activity 1, 2, and 3 all with their own tabs, but Activity 2 links out to Activity 4 (who does not have its own tab), but I would still like the tabs to appear in the header of Activity 4 so the user can simple navigate back to where they were quite easily. Can someone help point me in the direction to accomplish this?
Intent createNote = new Intent(RecipeNotesActivity.this, CreateNoteActivity.class);
startActivity(createNote);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种方法是 ActivityGroup 。
让您的 Activity 2 的选项卡托管一个 ActivityGroup。从那里,根据需要扩展到许多活动。请记住,如果您意识到内存消耗,则会花费更多内存。
我按照这个教程达到。祝您实施顺利。
One way to go for is ActivityGroup .
Make your Activity 2's Tab to host an ActivityGroup. From there, branch out to many activities as you need. Bear in mind that it would cost you more memory in case you are conscious about memory consumption.
I followed this tutorial to achieve. Good luck with your implementation.
是的,有可能,使用 Context.startActivity( ) (活动是一个上下文)。另请参阅Intent 开发指南以获取显式 Intents。
Yes its possible, use Context.startActivity() (Activity is a Context). Also check out the Intent Dev Guide for explicit Intents.