我们如何使用片段选项卡调用另一个活动? [英] How can we call another activity by using fragment tabs?

本文介绍了我们如何使用片段选项卡调用另一个活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有标签的片段,并且我在标签中使用 listfragment,我想在项目点击列表上进行另一个活动,我正在使用以下代码:

I am using fragment with tabs, and i use listfragment in tab,i want to go another acitivity on item clicklistner, i am using below code:

        Activity activity = getActivity();
        Intent i = new Intent(activity, Motherboard.class);
        startActivity(i);

它将转到另一个活动,但没有显示标签栏.我想要如果有任何活动调用,则标签栏保持在前面.请帮帮我.

it is going to another activity but it not showing tabbars. I want if any activity call then the tabbar remain infront. Please help me out.

推荐答案

除非您确实想编写一个超类来在所有继承自该超类的活动中实现选项卡栏,否则您可以尝试用另一个片段替换你的片段.还节省了大量内存.

unless you do want to write a super-class that implements a tab-bar in all of your activities that inherit from this super-class, you can just try to replace your fragment with another fragment. Saves alot of memory aswell.

这篇关于我们如何使用片段选项卡调用另一个活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆