android - Cannot load tab activity via activity group -



android - Cannot load tab activity via activity group -

i'm trying load activity tab via activity grouping activity isn't loading culminates in illegalstateexception error:

here re-create of log information:

01-10 11:01:06.201: info/weatherclockwidgetprovider(582): updatetime 01-10 11:01:06.201: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:01:06.211: info/weatherclockwidgetprovider(582): ontimechanged 01-10 11:01:06.211: info/weatherclockwidgetprovider(582): mhour01handindex = 1 01-10 11:01:06.211: info/weatherclockwidgetprovider(582): mhour01handindex = 1 01-10 11:01:06.211: info/weatherclockwidgetprovider(582): mhour01handindex = 0 01-10 11:01:06.211: info/weatherclockwidgetprovider(582): mhour01handindex = 1 01-10 11:01:06.211: info/weatherclockwidgetprovider(582): updatetime id = 3 01-10 11:01:06.211: info/weatherclockwidgetprovider(582): updatecurrenttemperature 01-10 11:01:06.221: info/weatherclockwidgetprovider(582): changeftoc 01-10 11:01:06.251: info/weatherclockwidgetprovider(582): updatecurrentlocal 01-10 11:01:06.281: info/weatherclockwidgetprovider(582): updatetemperatures 01-10 11:01:06.281: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:01:06.291: info/weatherclockwidgetprovider(582): hight = 48 01-10 11:01:06.291: info/weatherclockwidgetprovider(582): lowt = 43 01-10 11:01:06.291: info/weatherclockwidgetprovider(582): changeftoc 01-10 11:01:06.301: info/system.out(8418): waiting debugger settle... 01-10 11:01:06.301: info/weatherclockwidgetprovider(582): changeftoc 01-10 11:01:06.311: info/weatherclockwidgetprovider(582): updatedate 01-10 11:01:06.311: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:01:06.311: info/weatherclockwidgetprovider(582): updateweatherdescription 01-10 11:01:06.321: info/weatherclockwidgetprovider(582): updateupdatedtime 01-10 11:01:06.321: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:01:06.341: error/updateupdatedtime datestring(582): 1/10/2012 01-10 11:01:06.371: error/updatedtime before(582): update: jan.10 9:10 01-10 11:01:06.371: error/updatedtime end(582): update: jan.10 9:10 01-10 11:01:06.441: info/weatherclockwidgetprovider(582): bindviews 01-10 11:01:06.441: info/weatherclockwidgetprovider(582): appwidgetid = 3 01-10 11:01:06.501: info/system.out(8418): waiting debugger settle... 01-10 11:01:06.701: info/system.out(8418): waiting debugger settle... 01-10 11:01:06.909: info/system.out(8418): waiting debugger settle... 01-10 11:01:07.110: info/system.out(8418): waiting debugger settle... 01-10 11:01:07.311: info/system.out(8418): debugger has settled (1316) 01-10 11:01:07.501: error/gralloc(126): [unregister] handle 0x6335d0 still locked (state=40000001) 01-10 11:01:08.931: info/activitymanager(126): displayed activity com.pecappsradio/.tabs: 4886 ms (total 4886 ms) 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): updateallelements 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): updatetime 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): ontimechanged 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): mhour01handindex = 1 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): mhour01handindex = 1 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): mhour01handindex = 0 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): mhour01handindex = 2 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): updatetime id = 3 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): updatecurrenttemperature 01-10 11:02:00.091: info/weatherclockwidgetprovider(582): changeftoc 01-10 11:02:00.111: info/weatherclockwidgetprovider(582): updatecurrentlocal 01-10 11:02:00.111: info/weatherclockwidgetprovider(582): updatetemperatures 01-10 11:02:00.121: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:02:00.131: info/weatherclockwidgetprovider(582): hight = 48 01-10 11:02:00.131: info/weatherclockwidgetprovider(582): lowt = 43 01-10 11:02:00.131: info/weatherclockwidgetprovider(582): changeftoc 01-10 11:02:00.141: info/weatherclockwidgetprovider(582): changeftoc 01-10 11:02:00.151: info/weatherclockwidgetprovider(582): updatedate 01-10 11:02:00.151: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:02:00.161: info/weatherclockwidgetprovider(582): updateweatherdescription 01-10 11:02:00.161: info/weatherclockwidgetprovider(582): updateupdatedtime 01-10 11:02:00.161: info/weatherclockwidgetprovider(582): setcalendarinstance 01-10 11:02:00.171: error/updateupdatedtime datestring(582): 1/10/2012 01-10 11:02:00.171: error/updatedtime before(582): update: jan.10 9:10 01-10 11:02:00.171: error/updatedtime end(582): update: jan.10 9:10 01-10 11:02:00.201: info/weatherclockwidgetprovider(582): bindviews 01-10 11:02:00.201: info/weatherclockwidgetprovider(582): appwidgetid = 3

java code reads xml file containing tabhost , tabwidget controls:

public class tabs extends activity{ protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.tabmain); tabhost tabs=(tabhost)findviewbyid(r.id.tabhost); tabs.setup(); tabhost.tabspec spec=tabs.newtabspec("tag1"); spec.setcontent(r.id.tab1); spec.setindicator("tab1"); tabs.addtab(spec); spec=tabs.newtabspec("tag2"); spec.setcontent(r.id.tab2); spec.setindicator("tab2"); tabs.addtab(spec); spec=tabs.newtabspec("tag3"); spec.setindicator("favourites", getresources().getdrawable(r.drawable.favourites_star)); spec.setcontent(new intent(this,radioappactivitygroup.class).addflags(intent.flag_activity_clear_top)); tabs.addtab(spec); } private class radioappactivitygroup extends activitygroup{ protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); view view = getlocalactivitymanager().startactivity("radiotabs", new intent(this, favourites.class).addflags(intent.flag_activity_clear_top)).getdecorview(); this.setcontentview(view); } } }

xml code containg tabhost , layout controls:

<?xml version="1.0" encoding="utf-8"?> <tabhost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <tabwidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <framelayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <linearlayout android:id="@+id/tab1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"/> <linearlayout android:id="@+id/tab2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"/> <linearlayout android:id="@+id/tab3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"/> </framelayout> </linearlayout> </tabhost>

first read this official document of tab layout , after improve code

android

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -