android-tabhost

ServiceConnection.onServiceConnected() never called after binding to started service

 ̄綄美尐妖づ 提交于 2019-12-04 04:18:59
问题 In a game application I have the following scenario: From the main game Activity , the player starts several game tasks that run in the background with varying duration. The player should be able to view the progress of the running game tasks in a separate View . To do this, I created two Activity s and a Service , defined as follows: Service ProgressService handles several ProgressBar s running simultaneously on parallel threads. Activity WorkScreen2 creates a game task, starts the Service

ViewPager inside Fragment loses content when returning to it

最后都变了- 提交于 2019-12-04 03:35:39
I am implementing tabhost using FragmentActivity , under the first tab i load a welcome fragment that contains a Viewpager and CirclePageIndIcator , I need to load 4 views in side that WelcomeFragment this is my WelcomeFragment public class WelcomeFragment extends Fragment { PageAdapter mAdapter; ViewPager mPager; CirclePageIndicator mIndicator; List<Fragment> fragments; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.frag_welcome_layout,null); mPager=(ViewPager)view.findViewById(R.id

Add Image or style to each tab

醉酒当歌 提交于 2019-12-03 23:32:28
问题 i have app with many tabs, i want to add image or style to each tab , how please? th = (TabHost) findViewById(R.id.tabhost_template_two_tabs); th.setup(); // all tab spec = th.newTabSpec("All"); spec.setIndicator("All"); spec.setContent(R.id.tab_template_two_tabs_all); th.addTab(spec); // favorite tab spec = th.newTabSpec("Favorite"); spec.setIndicator("Favorite"); spec.setContent(R.id.tab_template_two_tabs_favorite); th.addTab(spec); th.setCurrentTab(1); Thanks 回答1: Try this : Call this from

Looking for a universal TabHost style that will work on Android, HTC Sense, Samsung, etc. skins

爱⌒轻易说出口 提交于 2019-12-03 19:59:45
问题 The default style for the Android TabHost works fine for straight Android systems. However, on HTC Sense, they use dark text on a dark background, which is unreadable. What's the easiest way to have a TabHost that has visible text across all the various flavors of android skins? I would prefer to not have to make a completely custom look-and-feel if possible. My targetSDK is 10 and my minSDK is 7. 回答1: I'll give you the advise to get completely independent from the TabWidget and create your

Show a progress bar on a child tab until the WebView loads

僤鯓⒐⒋嵵緔 提交于 2019-12-03 19:38:23
问题 In an Android app I am using a TabView and one of the tabs shows a WebView. But the page is blank until the web page loads. How would one show a progress bar until the page loads? It cannot be in the title bar because that is hidden by the tab host. 回答1: I use a ProgressBar for this. With a layout like this: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout [...]> <WebView android:id="@+id/WebView" android:layout_width="match_parent" android:layout_height="match_parent"/> <ProgressBar

Android 1.6 & Fragment & Tabhost

梦想的初衷 提交于 2019-12-03 18:49:24
问题 I'm working on upgrading an Android application (1.6 compatibility) which uses a TabHost to show 3 different tabs with nested activities. At the time I used the ActivityGroup trick to show nested activities in a tab but I'm very unhappy with this method since it's a real pain to handle some features. I heard about the Fragments API compatibility package for 1.6 and a Fragment looks perfect for what I want to do (show nested views / features within a tab with transition effects and stuff) but

Switching between fragmentTabs giving unexpected results

爱⌒轻易说出口 提交于 2019-12-03 16:09:09
I am trying to implement FragmentTabs as illiustrated in http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html . Everything went well until i did this: I started lots of different fragments from one tab like: tab1-->fragment1--->fragment2--->fragment3 tab2 But when i switched to tab2 and again came back to tab1, I got fragment1 screen not fragment3(i.e. I have 3 fragments in first tab and while i am on 3rd fragment and I come again on first tab after switching to second tab, I am taken to 1st fragment not 3rd)..Can anyone tell what

Android Refresh activity when returns to it

混江龙づ霸主 提交于 2019-12-03 16:09:02
问题 I need a little help with refreshing one of my activities in my application. I'm using tab host activity and connecting to web service and downloading some data from one of my child activities. When I press sync button in my child activity I'm starting a new activity which is not in tab host and when the sync is done, it returns to it's parent (child activity). The thing that I want to achieve is to refresh the activity when I return back to it. As I checked over the internet I find that the

error with google maps v2 in tab (MapFragment in Fragment)

风流意气都作罢 提交于 2019-12-03 16:02:54
I have a fragmentActivity where I build a tabHost and in each tab there is a Fragment. Well, I haver four tabs 3 with info and 1 with a fragment where is included a google-map-v2 (is a fragmentMAp in a Fragment because I want to add buttons etc.), when I select one tab and pass to other everything go well, but when I select the map tab, after that other tab and again the map tab an error is throw. My view seems like: |__||__|__|__| | __________ | || FRAGMENT || ||_____ _ || || FRAG| |_||| || MAP | || || | || ||_____| || ||__________|| The error: 01-29 08:32:56.979: E/AndroidRuntime(27738):

Getting reference to nested fragment from FragmentTabHost

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 15:22:01
问题 In my application, I use an Activity which holds one Fragment with FragmentTabHost and hence all its tabs are nested Fragments . Inside an Activity which holds a Fragment with its nested Fragment , we may get a reference to attached one using onAttachedFragment() . But how to get a reference to nested Fragment from FragmentTabHost ? 回答1: Well, exploring the source code of FragmentTabHost I've found that when it adds a fragment tab, it assignes a tag of TabSpec to nested Fragment . So to get