Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a horizontal-switchable activities
    primarykey
    data
    text
    <p>I have an application about debts to user and user's debts. Main activity is TabActivity for switching two activities with custom lists.</p> <hr> <p>It looks like (screenshot): <a href="http://i.stack.imgur.com/qts1f.png" rel="nofollow">http://i.stack.imgur.com/qts1f.png</a></p> <p>The code is:</p> <pre><code>public class MainActivity extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Resources res = getResources(); // Resource object to get Drawables TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab TextView tv = (TextView)findViewById(R.id.newDebtHeader); tv.setBackgroundResource(R.drawable.grad); tv.setTextColor(Color.BLACK); tv.setFadingEdgeLength(3); intent = new Intent().setClass(this, DebtsToMeList.class); spec = tabHost.newTabSpec("debts_to_me").setIndicator(null, res.getDrawable(R.drawable.ic_tab_debts_to_me)).setContent(intent); tabHost.addTab(spec); intent = new Intent().setClass(this, MyDebtsList.class); spec = tabHost.newTabSpec("my_debts").setIndicator(null, res.getDrawable(R.drawable.ic_tab_my_debts)).setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(2); } } </code></pre> <p>main.xml is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="1dp"&gt; &lt;TextView android:id="@+id/newDebtHeader" android:layout_height="24dip" android:layout_width="fill_parent" android:gravity="center_vertical|center_horizontal" android:textStyle="bold" android:textSize="16dip" android:text="хДолги"&gt; &lt;/TextView&gt; &lt;TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp"&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp" /&gt; &lt;/LinearLayout&gt; &lt;/TabHost&gt; &lt;/LinearLayout&gt; enter code here </code></pre> <p>But I don't like TabActivity, I want change this two lists by horizontal finger drag. Could you please help me change my code?</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