How to use intent between tabs in java/Android? -


I should know how to handle intents between tabs For example, I have tabbed tab activity with two tabs But first there is a text view. Second is another map view when I click on that text, it is redirected to tab 2. It can be easily obtained from setCurrentTab (1) or setCurrentTabByTag ("Tab2") methods. But I want to leave that Pin Activity latitude and long that map activity. What is the best way to use intents or gator / setter in Java? What do you want to do? If your answer is "intents" how? An interesting problem I think is that you want to change the first tab in one tab to another tab in the first tabview, But on the second tab can also pass special data which is dependent on action in the first tab.

I will usually start my thoughts inside the tab with an activity. However, the tab host is configured at this time. This means that for both activity, both sides give the same aspect, which allows a user to choose for a long time and who looks late in the same time.

So you can not add information to the intent used to intialize tab hosts. I do not like the solution, but the only thing that comes to my mind (using different activities for tabs) is using a custom, which stores the context of the object that you will see in another tab Views need to be updated. You have to apply with your class and add this class to the manifest, you can now call getApplication in the first tab, set your application class and set the set. In the second tab, you can call again and then you will get an application object which is the same for each activity in every minute of your app running. Then you have put it in your application object and have retrieved late and long value. Find out how to use custom presentation classes in Google REF.

To use a custom application class, add the following to your application tag in your manifest:

  & lt; Applications ... Android: Name = ". Somepackage.CustomAppClass"  

This will allow Android to present the custom application class as your application class at the time of app launch. You have to expand the application to avoid errors initially.

There is another solution, but what I like, it is to initialize ideas on itself and start the tabhost with ideas and not for activities. It can be very large with a map view from one of the tabs.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -