Android :: Manage Multiples Activities Under A Single Tab Of TabActivity?
Jul 8, 2010
In my app, I have 5 tabs which contains activities. In each of them, I have to show differents screens. For example, the main activity of a tab is a listview, and when I click on one of its item, I want to display a second screen with an other listview, that will display an other screen when the user will select an item etc.
So I knew that activities in tabs are not easy to manage, but I really think that I needed this solution. Indeed, each screen must contain a back button, which will return to the previous screen, with the previous state (the same position in the list).
To start new activities inside the tabs, I used the technique described here http://gamma-point.com/content/android-how-have-multiple-activities-under-single-tab-tabactivity
It works mostly well, but I encounter a problem to go back to the previous activities. My solution at the moment consists in starting the previous activity like it's described on this website, but without any flag.
So here are my two real problems:
When I try to go back to the first and main activity of the tab, it seems that a new instance is created, even if I use the flag Intent.FLAG_ACTIVITY_CLEAR_TOP. So when I do several roundtrips between this activity and the next one, i obtain a StackErrorOverFlow.
Because the activities are accessible from differents activities, I have to memorize the parents activities all the time, by giving them in the intents. It's really heavy when I have a succession of 5 or 6 screens, I have to memorize the grand grand parent if the activity... I really appreciate if I just could call the last Activity started by the localActivityManager.
View 3 Replies
Nov 22, 2010
I am designing an app that will have some activities separated in tabs. Some of them will have to perform tasks in the background will the user is in another tab. What is the best strategy for designing an app like this? I was thinking about using a service but it can be killed by android dalvik, isnt it?
View 1 Replies
View Related
Mar 12, 2010
I have a TabActivity. Each tab points to a sub activity. Works great.
Is there any clever way to refresh one of the activity tabs? I just want to 'restart' the activity in tab #3 for example. Not sure of a good way to do this other than building in refresh support to the activity itself, or clearing ALL the tabs and recreating all of them.
View 1 Replies
View Related
Feb 10, 2009
I'm trying to implement my own ActivityGroup to mimic TabActivity (without tabs) but I'm having trouble "closing" activities.My ActivityGroup has a ViewFlipper, each housing a separate activity's window.When I attempt to switch "activities" I call ViewFlipper.setDisplayedChild() on the view of choice.However, when I scroll up and down in the view of choice, the OTHER non-visible activities' views are responding to these actions, so it seems like I'm not successfully "switching" the activity fully.When I use a TabActivity to run this code, this doesn't happen; when I scroll up and down in one activity, I don't see any event firing from any of the other activities. I'm wondering what does TabActivity do to handle these activities as separate, individual entities?
View 9 Replies
View Related
Mar 17, 2010
I've been programming in Android for two years now and just joined an Android project where they are using a TabActivity to host multiple Activities. It's unclear why this is better than rewriting the TabActivity to simply use Views instead.
TabActivity extends ActivityGroup which means TabActivity can host both Activities and Views. But what's the use of this capability? I was under the impression that Activities should be treated as individual screens of an application.
In short, what is an example use case where it's recommended that TabActivity should host multiple Activities rather than multiple Views?
View 4 Replies
View Related
Jul 25, 2010
I am using a TabActivity (Main) with 3 TabSpecs
I am using Intents for the content of the 3 Tabs
TabA, TabB, TabC for example.
All these tab activities use common data that is stored in SharedPreferences
In the Main TabActivity I have an options menu which has a refresh option.
CODE:.............
This refresh uses an AsyncTask (updateCommonDataFromWeb) to reload the common data from the web.
I need a way to tell the 3 tab activities to refresh their views and rebuild their content from the newly downloaded data.
When the tab activities are first created they load the data from SharedPreferences like so:
CODE:..............
I thought about making a common method on each of the tab activities
like.... reloadViewData()
I thought maybe I could use the activity manager from the Main TabActivity to get the activity of the current tab like so:
CODE:.............
Unfortunately i cant get this approach to work, whilst activity is the correct instance its an Activity instead of a TabA,TabB or TabC
Maybe i've completely taken the wrong approach to the whole thing.
I have also read alot about not using Activities for tab content instead using views.
However I dont know what view to use to replace my <RelativeLayout /> as i cant use my R.layout.* as views.
View 2 Replies
View Related
Jul 24, 2010
i identified problem in changing one activity using tab, in on tab activity i am adding data to sqlite in other tab activity i am displaying them using listview(array adapter)but when i come back to add data and after adding new item to sqlite the newly added records are not updated in listview.
View 3 Replies
View Related
Mar 11, 2010
I have two activities, one per orientation - PortraitActivity and LandscapeActivity. They are pretty much different, I can't use one Activity with different layouts. If user changed orientation I have to shutdown one of them and start another. What is the best way to manage them? Does it make sense to create GroupActivity? Or each Activity should check if the current orientation is what it needs? If so, is it save to start new Activity in onCreate method of previous one (which is not actually created yet)?
View 5 Replies
View Related
Nov 19, 2010
Were looking into Android for writing a tablet based system. Part of the design is for the system to be as modular as possible. One aspect of this is to display any "STATUS" activities in a side view on the screen. It looks like I can use PackageManager queryIntentActivities() to find the activities that show status information. But, can I display these in a single view all at the same time (via a linear layout)? The activities would be installed in separate apk's (features). Can this be accomplished using ActivityGroup? Is this even allowed in Android? Everything I've read implies that Activities take the whole screen or float on top. This implies only one activity can be active at a time where as the design I'm thinking of uses the activities more like widgets.
View 1 Replies
View Related
Jun 10, 2009
Can we run two activities on a single screen? if so, then could anyone give me an as to how its done?
View 4 Replies
View Related
Jun 12, 2010
I want to know if we can display multiple activities in a single activity using ActivityGroup.Can anyone please help me out with this?
View 1 Replies
View Related
Oct 6, 2010
I have an application which has multiple activities associated with it. When the user clicks on the launcher icon I want the last used activity of the application to be shown.
What's the best way to accomplish this?
View 1 Replies
View Related
Oct 13, 2010
I have created two tabs, say TAB1 and TAB2. For TAB1, i have loaded one Activity, say ActivityOne, into TAB1 as Code...
When we click on that button ActivityOne_One will be launched under same TAB1. In this application i have two problems:
1) If i want to go back to ActivityOne under same TAB1 by using traditional BACK button on emulator it is not working..
2)ActivityOne_One is launching with no animation(like sliding from right to left) effect.
If anyone know about any one of these, give your advice.
View 1 Replies
View Related
Dec 15, 2009
I have a todo list type application that stores all of the note data in a sqlite3 database. Each activity in the application needs access to the database to edit different parts of the data in real time.
Currently, I have each activity open its own DBManager object (the helper class I created to manage the database). This is causing problems though and I would like a slightly more global access solution so I don't have to keep opening/closing/creating a database.
I'm considering several options, and would like to hear pros and cons of each as well as other suggestions.
Singleton style. Have a wrapper class that returns a reference to the only database manager so any activity that needs it can use it.
Static Manager. Have the manager class be entirely static members and have it open the database on load. Easily accessible by anyone that needs it (which is everyone).
Merger between 1 and 2. I could make a database manager class that initializes the member singleton instance of the database and all of the data manipulation methods were static. Then I wouldn't even need a reference to the singleton to access the database.
View 3 Replies
View Related
Aug 30, 2010
How can i improve the performance of simultaneous processes agains the time and space in androied?
View 1 Replies
View Related
Dec 12, 2009
I'm having an issue with some of my texts sending out multiples, even though I've only sent once, and receiving some in multiples as well.Not the problem of phantom messages.Just duplicates.Anyone else having this problem?
View 2 Replies
View Related
Jun 30, 2010
how to call BarCodeScanner, and return the value to a field.so now, i have a toast that says "successful scan" and then i want to pass the result to a new activity. when i comment out my intent, everything works (minus the passing of data/switching of screen, obviously) but when i run my project as is, it FC's no errors reported by eclipse in code or xml. any insights?
View 2 Replies
View Related
Jun 15, 2009
I created a TabActivity with contains 3 tabs. Each tab's content sets different Intents.I would like to add a "footer" wich will appear on each tab. So I get TabActivity's FrameLayout and add it my footer view.Is it possbile to define where place the footer (with an attribute like AT_BOTTOM)? So contentTab dimensions are calculated according to this footer.
View 4 Replies
View Related
Oct 12, 2010
I have a TabActivity with 3 tabs. Each tab contains its own Activity. When one of the contained Activities pops up an AlertDialog, there are actually 3 dialogs created. The dialog has a Dismiss button and it must be pressed 3 times to finally dismiss the 3rd dialog.
View 2 Replies
View Related
Oct 1, 2009
How can I return a value from TabActivity? It seems that the return value from tab pages vanishes and the caller always receives RESULT_CANCELED instead of RESULT_OK.
View 3 Replies
View Related
Aug 18, 2009
More of a TabWidget question I guess really...
I would've tried to send a screenshot for this query if I could, but i'll try and explain.
I have 3 Tabs, each showing a separate Activity. Underneath those tabs (and above the activity display), I want to display a header. This header would probably be a Layout of some sort with a TextView inside it and a background 9patch.
Is this possible, if so how?
View 2 Replies
View Related
Feb 2, 2010
I am having a problem.I want to explain in detail. 1)I am Having an TabActivity with 5 tabs. I loaded content as follows.
CODE:............
And the Problem is If i want to start activity which is not specified in tabhost in above Java code,it is going out of tabactivity. ie.,It is not coming in tabactivity.
2)But i want to have all the activities under tabActivity.
View 4 Replies
View Related
Aug 12, 2010
I create a TabActivity from Several ListActivities.
The lists are created from a cursor load in a AsyncQueryHandler. I have got no problem to load the content of the list.
After that I run an insert in the AsyncQueryHandler, and I meet the following error. The insert is done by the listActivity.
If I run my listActivity individually and that I do my insert, everything is find. Do know why ?
CODE:.......................
View 3 Replies
View Related
Mar 26, 2010
I'm having some difficulties getting the TabActivity to work.
Here's the implementation of the class:
CODE:..........
The problem is that I call this class from my main activity (which is a MapActivity if it matters) and when I do the TabActivity doesn't show. It registers the click on the option menu and it even starts the intent but the screen doesn't change..it just stays on the main activity and i see in the logs that the main activity gets resumed.
I call it like this:
CODE:...............
Like I said...there are no errors (the classes called from the tabs exist of course), just no actions. I put some log commands into the onCreate function in the tabactivity (as you see) and they all get written into the log...I have no idea what I'm doing wrong here.
View 3 Replies
View Related
Dec 7, 2009
I'm working on Android v1.5. I want to use a TabActivity with 6 or 7 or more tabs. However, I do not want to clutter my screen with so many tabs together. Hence, I'd like to be able to show, say, 3 tabs on the screen, and to be able to scroll to the other tabs. How may I achieve this? I could not find any example for this by Googling.
View 5 Replies
View Related
Apr 13, 2010
Can I make TabActivity start it's childs activities for result? I need it because I can't make result code from a tab to propagate all the way up in the chain (it's reset in the TabActivity)
View 1 Replies
View Related
Aug 18, 2009
I have a TabActivity based class which has 3 tabs. All are ListActivities (but that's not important for this problem)
I'm updating the TabHost's TabSpec's to change the text on the tabs. This works fine and the ListActivities display correctly.
Iater on the execution flow I need to update the Text on the tabs from "Current Text" to "Current Text (3)", for example. I update the TabSpec.setIndicator() with the new text, and attempt to call invalidate() on the TabWidget (and all it's children). But the tab text refuses to update!
View 5 Replies
View Related
Nov 17, 2010
I have been trying to reuse the tutorial on the Android developer website about developing a TabActivity App but, unfortunately, it never worked, even when I constructed it the exact same way as it is described...
Using the debugger it seemed the problem came from the main layout.
-> setContentView(R.layout.main); //After this line the app stops.
Here is my main.xml:
CODE:.............................
View 1 Replies
View Related
Jun 20, 2010
I am trying to override the behavior of a TabActivity that has other Activities as children. I have made all of the children activities return false in onKeyDown so that the key will propagate through to the parent.However, this is not the case.The only key that is being recognized is the search key.Back, menu, and home are not being overridden.
View 6 Replies
View Related
Feb 10, 2010
I have issues with displaying a ListActivity in a TabActivity.
The super simple code below causes a crash.
CODE:.....................
View 5 Replies
View Related