问题是这样的:希望每次切换的时候重新启动activity,其中一个activity是连接网络加载数据,如果该activity已经成功显示数据,那么在切换tab时就不需要重新启动;如果没有成功显示,则每次切换都希望重新启动该activity来连接网络再次加载,请问该怎么实现?
解决方案 »
- 一个view如何对touch事件进行分发?
- Socket代码问题
- git clone下载内核warning: remote HEAD refers to nonexistent ref, unable to checkout
- 这是怎么回事呢?运行不起来。。。求助~~~
- 看看Android.mk里面怎么错了
- 如何在一个按钮的右下角显示一个图标?
- android多语言切换的问题
- 只知道手机号码如何进行消息推送 ,不提供SDK和其他服务的前提下,有解决方案吗?!
- 修改android源码中应用包名编译问题
- Android之Error: 'L' is not a valid file-based resource name character如何解决
- 困扰一周的问题,至今无解,求大侠指教
- Android中使用正则表达式处理字符串
tabs.setCurrentTabByTag(tag);
Intent productsIntent = new Intent(this, ProductActivity.class);
Bundle param = new Bundle();
param.putInt("Categories", 0); //Your id
param.putCharSequence("CategoryName", "No Category");
productsIntent.putExtras(param);
productSpec.setContent(productsIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
在不同的activity中访问tabHost
Intent productsIntent = new Intent(context, ProductActivity.class);
Bundle param = new Bundle();
param.putInt("Categories", 1); //Your id
param.putCharSequence("CategoryName", categoryValues[position]);
productsIntent.putExtras(param);
MainTabActivity.productSpec.setContent(productsIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
MainTabActivity.tabHost.setCurrentTab(1);