Note that there are some explanatory texts on larger screens.

plurals
  1. POTab navigation problems
    primarykey
    data
    text
    <p>I am using tabs in the activity class using TabHost. </p> <pre><code>TabHost tabHost=(TabHost)findViewById(R.id.tabHost); tabHost.setup(); Test testObj = new Test(this); spec2=tabHost.newTabSpec("Tab 2"); spec2.setIndicator("Tab 2"); spec2.setContent(testObj); </code></pre> <p>And each view is assigned to a view that implements TabFactory.</p> <pre><code>public class Test implements TabContentFactory { @Override public View createTabContent(String arg0) { v = mInflater.inflate(R.layout.activity_tab1, null); /** * Add your code here for buttons/list etc * An object lookup for your Button: */ b = (Button)v.findViewById(R.id.button1); b.setOnClickListener(this); return v; } public void setListViewNames() { //create a custom list view } public void setDetailedView() { //opens another detailed view when user clicks on any item on the list //here i use ViewGroup to remove the first view created in setListViewNames() } } </code></pre> <p>On button click, a listView is created. Clicking on any item will take to another listView. The first listView is removed as:</p> <pre><code>ViewGroup viewGroup = (ViewGroup) v.getParent(); viewGroup.removeView(v); View v1 = mInflater.inflate(R.layout.custom_fullpicture, null); viewGroup.addView(v1); </code></pre> <p>But when I go to tab one and then click on tab two, the following error is thrown.</p> <pre><code>E/AndroidRuntime(1668): at android.widget.TabHost$FactoryContentStrategy.tabClosed (TabHost.java:658) </code></pre> <p>How do I effectively navigate in the tabs? I could not find a way to reload the tab view every time it is clicked.</p> <p>Any thoughts?</p> <p>Thanks in advance!</p>
    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.
    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