Note that there are some explanatory texts on larger screens.

plurals
  1. POReplacement deprecated TabActivity with FragmentActivity
    primarykey
    data
    text
    <p>i develop an application on android which is thus structured: <img src="https://i.stack.imgur.com/f3ns1.png" alt="enter image description here"></p> <p>Activity 1, Activity 2, ..., Activity n - are tabs with related Activity.</p> <pre><code> TabHost tabHost = getTabHost(); Resources res = getResources(); View view = null; Context ctx = MyApplication.getInstance().getApplicationContext(); TabSpec startspec = tabHost.newTabSpec("Login"); view = prepareTabView(ctx, "Login", res.getDrawable(R.drawable.menu_bkg), R.drawable.tab_files_selector); startspec.setIndicator(view).setContent(new Intent(this, LoginActivity.class)); tabHost.addTab(startspec); </code></pre> <p>TabActivity content view:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/title_band" android:orientation="vertical" &gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:orientation="vertical" &gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clipChildren="false" /&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/RelativeLayout&gt; &lt;/FrameLayout&gt; &lt;/TabHost&gt; </code></pre> <p>My problem is:</p> <p>How replace TabActivity with FragmentActivity or another else, so I use tabs with all the same activities ?</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload