简体   繁体   English

刷新 TabActivity 的 Tab 内容

[英]Refresh content in Tab of TabActivity

I have a tab with an intent as its content:我有一个以意图为内容的选项卡:

    tabHost.addTab(tabHost.newTabSpec("tab3")
            .setIndicator("Chart")              
            .setContent(lineChartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));  

How is it possible to refresh the content of a tab?如何刷新选项卡的内容? I am thinking of a method like我正在考虑一种方法

tab.refreshContent()

or similar.或类似的。 Background is: My intent contains a graph and I want to repaint this graph upon click of a button while the tab remains selected.背景是:我的意图包含一个图表,我想在选项卡保持选中状态时单击按钮重新绘制此图表。 Thanks.谢谢。

best way i know我知道的最好方法

finish();
startActivity(getIntent());

it refresh all the Activity它刷新所有活动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM