English 中文(简体)
Anders tabs - 避免在刺tab点上重新开展活动
原标题:Android tabs - avoid recreating activities on tab clicks

我用三条表格显示三页不同的网页。 然而,我担心的是,我没有足够控制整个事情是如何运作的。 当我点击一个表格时,我有一个网页装上(见下面的编码样本),现在我点击另一个页面负荷。 当我回到第一个表格时,整件物品再次陷入了危险之中,并装上了页数。 如果我想要的话,我如何能够控制这种局面,并在目前状态中保持下调活动(而且只说“新”一页的改动)。

我是否有必要处理有关方法或作为单一活动观点而执行我的表格(这完全是可能的)? 我如何储存我的活动状况,避免每次重新开始活动?

如何看待这些活动:

intent = new Intent().setClass(this, tab_schedule.class);
  spec = tabHost.newTabSpec("Schedule").setIndicator("Schedule",
    res.getDrawable(R.drawable.tab_icon_schedule)).setContent(
    intent);
  tabHost.addTab(spec);

a. 表格-附表。

@Override
 public void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);
  setContentView(R.layout.tab_people);

  try {

   WebView currentView = (WebView) findViewById(R.id.tab_people_WebView);
   currentView.getSettings().setJavaScriptEnabled(true);
   currentView.loadUrl("http://pda.lenta.ru");

  } catch (Exception e) {
   Log.v("webClientInit", e.getMessage());
  }
 }
最佳回答

如果你不想为每个表格创造新的活动,那么你可以使用TabWidget, 并用一个框架Layout toggle between observations。

关于转换活动,见question。 避免每次重新开展活动。

不管怎样,你们都应始终如一地在停下来,恢复你们的感受。 您不妨在rel=“nofollow noreferer”>Actative Life Mill上读,但基本上不能阻止你的活动在背景中丧生。 因此,你应该把你的国家储存在垃圾中。 上述联系还有助于如何做到这一点。

问题回答

把以往的活动放在 st使用意图之上。 旗帜(Intent.FLAG_ACTIVability_REORDER_TO_FRONT);





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签