tabactivity

Android: onActivityResult() is not calling

烈酒焚心 提交于 2019-12-08 11:24:15
问题 I'm facing with a problem related onActivityResult(). I use TabActivity as a main Activity. Each of the tabs is activityGroup. A ActivityGroup's sub-activity A(Activity) sends the intent to B(Activity) using startActivityForResult( , ) . But when B Activity finish, onActivityResult() is not called in A. A Activity Intent intent = new Intent(A.this, B.class); startActivityForResult(intent, 1); B Activity Intent intent = new Intent(); setResult(RESULT_OK, intent); finish(); What is wrong?

Android TabActivity Back Button Functionality with Multiple Child Activities

这一生的挚爱 提交于 2019-12-08 08:17:50
问题 i have TabActivity in android project which contains some tabs. In each tab i can open various activities, and after open it in a tab i want go back to previous activity in same tab, but default android behavior close my root tab activity. How i can realise behavior that i need? 回答1: There are a few ways of doing this. The first involves creating a custom GroupActivity that will keep track of the stack from the LocalActivityManager and then extending that class for each of your tabs. For that

TabActivity with ActivityGroup and PreferenceActivity child

心不动则不痛 提交于 2019-12-08 03:25:44
问题 I have a TabActivity where each tab has ActivityGroup. On the home ActivityChild of the first group I have an menu option, which gives to the user the option to open preferences. When I click "Preferences" on menu, I start PreferenceActivity inside ActivityGroup, which shows PreferenceActivity on the first tab. The problem is when I click on any specific preference which has to show a Dialog (for EditTextPreference). I have the following exception: android.view.WindowManager$BadTokenException

how to know when view has inflated using the onFinishInflate

霸气de小男生 提交于 2019-12-08 01:20:45
问题 I want to know when my TabActivity has inflated so i tried this code @Override protected void onFinishInflate() { super.onFinishInflate(); } i get the error: must override or implement a supertype method I cannot understand why that is not working in the TabActivity. Can Anyone explane this? package com.carlsberg.bungle.history; import com.carlsberg.bungle.Consts; import com.carlsberg.bungle.R; import android.app.TabActivity; import android.os.Bundle; import android.util.Log; import android

Swipe to switch tabs on Android, like the YouTube/Google Music apps

纵然是瞬间 提交于 2019-12-07 05:42:28
问题 In their latest versions of their apps, Google has implemented a pretty cool way of swiping between tabs versus clicking tab headers. I was wondering if someone has more concrete ideas of how this is done. Here are some thoughts - feel free to critique: My initial thought is that this isn't a standard TabActivity which hosts child activities. Infact, I don't even think it's a custom ActivityGroup either. The row of tabs scrolls when swiped, but doesn't cause the active tab to switch. Swiping

Android TabHost is there a way to get TabView by ID

泪湿孤枕 提交于 2019-12-06 13:31:49
I'm making some an advanced TabActivity but I need to get every TabView thats in the TabHost . With tabHost.getCurrentTabView() I can get the current TabView but is there a way to get a TabView by its ID? I managed to make a workaround by doing a for loop in the onCreate() method where I go to every tab and put all the View objects in an Array. private View[] tabs; for(int i = 0; i < getTabWidget().getTabCount(); i++) { tabHost.setCurrentTab(i); tabs[i] = tabHost.getCurrentTabView(); } There is no TabView in Android. To find the contents of a tab via its ID, call findViewById() on the TabHost

How to setResult() for a TabActivity which contains activity for tabs

只愿长相守 提交于 2019-12-06 09:38:15
My TabActivity contains two tabs which calls two two different activities . I want to setResult() for the TabActivity when either one of the child finishes. Is there any method to find out when my activity inside tab finishes ? Thank you -Eby I found another way ` @Override public void finishFromChild(Activity child) { setResult(REFRESH); super.finishFromChild(child); } ` finsihFromChild will let us know when the child activity is finishing!! @pentium10 thank you very much for your suggestion.. Rohi Zacharia Ok i've got an even easier method to pass the result: in your child activity do this

how to know when view has inflated using the onFinishInflate

无人久伴 提交于 2019-12-06 05:28:42
I want to know when my TabActivity has inflated so i tried this code @Override protected void onFinishInflate() { super.onFinishInflate(); } i get the error: must override or implement a supertype method I cannot understand why that is not working in the TabActivity. Can Anyone explane this? package com.carlsberg.bungle.history; import com.carlsberg.bungle.Consts; import com.carlsberg.bungle.R; import android.app.TabActivity; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.widget.TabHost

Why does the first tab activity in Android live forever?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 23:04:49
I've created a simple TabActivity which builds tabs at runtime reading some JSON data. At the moment I'm initializing an empty ListActivity with dummy random items for each tab just to see that changing from tab to tab works and the content doesn't disappear. The actual content for the tabs is stored in a singleton class, so when the tab activities get re-created due to a screen orientation change, they just pull the correct dummy items from the respective list according to an identifier contained in the intent's extras bundle. Everything works fine. I've put a log on the list activity

Swipe to switch tabs on Android, like the YouTube/Google Music apps

蓝咒 提交于 2019-12-05 09:34:07
In their latest versions of their apps, Google has implemented a pretty cool way of swiping between tabs versus clicking tab headers. I was wondering if someone has more concrete ideas of how this is done. Here are some thoughts - feel free to critique: My initial thought is that this isn't a standard TabActivity which hosts child activities. Infact, I don't even think it's a custom ActivityGroup either. The row of tabs scrolls when swiped, but doesn't cause the active tab to switch. Swiping the main content of the tab exhibits interesting behavior. I suspect there is a GestureListener