gpt4 book ai didi

android - 将字符串从子选项卡 Activity 传递到父选项卡

转载 作者:行者123 更新时间:2023-11-29 22:03:29 26 4
gpt4 key购买 nike

我有一个名为“Tabs”的 Activity 。它启动 4 个不同的选项卡,每个选项卡都有自己的 Activity 。它使用:

th = (TabHost) findViewById(R.id.tabhost);
th.setup(this.getLocalActivityManager());
TabSpec specs = th.newTabSpec("Tag1");
Intent tabSelection = new Intent (this, ProfileSettings.class);

tabSelection.putExtras(gotSettings);
specs.setContent(tabSelection);
specs.setIndicator("Settings",
getResources().getDrawable(R.drawable.ic_menu_friendslist));
th.addTab(specs);

specs = th.newTabSpec("Tag2");
tabSelection = new Intent (this,InternationalRoamingService.class);
specs.setContent(tabSelection);
specs.setIndicator("IRS", getResources().getDrawable(R.drawable.ic_menu_mapmode));
th.addTab(specs);

specs = th.newTabSpec("Tag3");
tabSelection = new Intent (this,Call.class);
specs.setContent(tabSelection);
specs.setIndicator("Call", getResources().getDrawable(R.drawable.call));
th.addTab(specs);

specs = th.newTabSpec("Tag4");
tabSelection = new Intent (this,WebSMS.class);
specs.setContent(tabSelection);
specs.setIndicator("SMS", getResources().getDrawable(R.drawable.ic_menu_start_conversation));
th.addTab(specs);

我可以毫无问题地将包“gotSettings”从父级传递给子级。但是,如何从子 Activity 更新包的值或将值从子 Activity 传递给父 Activity ?

最佳答案

有两种方法:

关于android - 将字符串从子选项卡 Activity 传递到父选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11380465/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com