Note that there are some explanatory texts on larger screens.

plurals
  1. POSelection problem in tabs
    primarykey
    data
    text
    <p>I am making an application where i need tabs placed at the bottom of the screen . I have managed to get to implement the code of tabs but i can't get them to be placed in the bottom of the screen.</p> <p>Also i don't want any of the tabs to be selected i.e. i just want four tabs to be present at the bottom of the screen and above the tabs there are some image views and buttons.</p> <p>I have linked the tabs to respective activites but i don't want the tab bar to be functional until the user wants to go and click it.</p> <p>Till then i just want a normal gui screen with tabs at the bottom with none of them pre selected.</p> <pre><code>package com.tabs; import android.app.TabActivity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.widget.TabHost; public class HelloTabWidget 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 // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, ArtistsActivity.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("artists").setIndicator("Artists", res.getDrawable(R.drawable.ic_tab_artists_grey)).setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs intent = new Intent().setClass(this, AlbumsActivity.class); spec = tabHost.newTabSpec("albums").setIndicator("Albums", res.getDrawable(R.drawable.ic_tab_artists_grey)).setContent(intent); tabHost.addTab(spec); intent = new Intent().setClass(this, SongsActivity.class); spec = tabHost.newTabSpec("songs").setIndicator("Songs",res.getDrawable(R.drawable.ic_tab_artists_grey)).setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(2); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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