Note that there are some explanatory texts on larger screens.

plurals
  1. POAchartengine graphs in tab view
    primarykey
    data
    text
    <p>I am a beginner, and was doing somework arounds with lists and charts. I used the same code as supplied from achartengine samples. My launcher activity, which is deriving from TabActivity has its create method as follows,</p> <pre><code>setContentView(R.layout.tabstrip); 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 SalesBarChart myChart = new SalesBarChart(); intent = myChart.execute(this); spec = tabHost.newTabSpec("BarChart").setIndicator("BarChart", res.getDrawable(R.drawable.ic_tab_barchart)) .setContent(intent); tabHost.addTab(spec); AverageTemperatureChart myChart1 = new AverageTemperatureChart(); intent = myChart1.execute(this); spec = tabHost.newTabSpec("albums").setIndicator("Albums", res.getDrawable(R.drawable.ic_tab_linechart)) .setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(1); </code></pre> <p>My xml file looks like,</p> <pre><code> &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_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; </code></pre> <p></p> <p>The same intents i fire in startactivity(intent) on a button click works, but doesnt work in tabs. Please help. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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