In my application I want to use 4 tabs and each tab will have more than one screen. So I tried to get this and found there are two ways to do this:
Use ViewFlipper inside every tab.
Use ActivityGroup in tabs.
However, I'm not sure which will be efficient and easy way to do this since I'm a newbie in Android. So please help me.
Please post me some link where I can get sample code related to ActivityGroup.
Activities are self-contained parts of your app, views are used together when they display similar type of data/behavior.
For example if your tab 1 is taking a picture and your tab 2 is showing a map and your tab 3 is sending an email then you're better of using activities as the action are completely different, with different layouts and different behaviors.
If tab 1 is a listview with an rss feed from techcrunch, tab 2 is a rss feed from StackOverFlow and tab 3 is a rss feed from bbc news then use a viewflippers : Same behavior, same actions
THis is simple to implement
Adding Activity Group will be more preffered then adding View Flipper. By this all the code and activity contents are separated and in more manageable form plus its a stable thing to use
I have the same issue but got it totaly RESOLVED Check The Following Link
http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html
Changing the view within the Android Tab Widget
Its The Solution For Me . Hope It will Help You as Well
Related
I want to open multiple tabs within one webview. I can manage to load one url at a time. I am understanding that i have to customized my webview to do so. Is it possible, like as my below picture ?
Any suggestion , tutorial or guideline is appreciated.
Tabs are simply not part of WebView, you need to develop such features around it yourself.
E.g. you could use a TabLayout to implement the tabs, and update the state of the WebView according to the selected tab. You can easily find tutorials all over the place detailing tabs.
I have existed code for two activities(ActivityA and ActivityB).
Now I need to have a another activity, which will act as my first and only screen of my application. This activity will be having two tabs on its header part and I need to display each of my Activity when user press on each tab.
I have done some search on this and found TabAcivity will be suitable choice, but it is deprecated now.
I saw many posts which are suggesting Fragments. But I dont want to change my existing code. Can any one suggest me easy method to incorporate this.
you can use Android Tab Layout with Swipeable Views
here i give Link in this link step by step information given. so i think you can get batter idea from that.
Tab Layout with Swipeable Views
you can also download code from this site and also see video in given sit
I want a tab view activity which will display 3-4 screens in it. I don't care if tabs are fixed or can swipe but I want it to support atleast API 8 or min. a rough overview you can get by below image.
Please let me know what should I use and is there any build-in API or something that can help.
Thanks for your help.
Regards,
Sourabh
Navigating using tabs is easily implemented using TabHost. There is one main Activity which lists all the tabhosts, and they define the other screens. This is explained very well in this tutorial. http://www.mkyong.com/android/android-tablayout-example/
The code for each screen is written on a seperate Activity.
Hope this answers your question.
I'm new to Android programming and I'm working on my first application "FunFacts" where
there should be more than 100 cool things to learn about nature, science etc.
My question is: How can I switch from one page to another using two buttons "left" and "right"? which method should I use? I don't think that a horizontal scrollview is the solution.
So if I have 2 different layouts, page one and page two, how can I switch from one to other in my application?
Thank you!
It sounds like you might want a ViewPager. Below is a link to the Android tutorial. This creates a slideshow type effect which sounds like what you're going for. You said you will have different layouts which this will use one layout but you can customize the content and I would think you would want one so it all looks relatively the same
Docs
Update
No, you don't have to create 100 layouts or activities. Just one of each. Following will be a link to a post that explains it a little better. That post explains how it is like a listview in that you add the different pages to your view adapter as you would with a list. You can use the same layout for all and just add new data to it (like a list). Probably store them in an ArrayList or possibly a DB if you have that many and want to have a lot of data attached to them. I hope this makes sense and helps a little. I would suggest starting one with just a couple pages to see how it works, following these examples, and if you get stuck then post a more specific question as to what you can't get to work.
Link
I am having 3 tab in the tab bar.I would like to have an access when we we click the first tab it need load the Activity 1<->Activity 2 <->Activity 3 <->Activity 4.How to get this,any examples on this will be helpful. I have tried all other examples with single activity but when I try to call the multiple activities no luck on it.Thanks
As I got from your question is that your requirement is to have Sub-Activity inside a Single Tab. You can use ActivityGroup for that, but now it is deprecated you can use Fragments Compatibility Package which works from 1.6 version too. So, here is an example for that FragmentTabs.java