Android :: How To Use Multiple Map Activities / Views?

Jul 31, 2010

My situation is the following: I have written one MapActivity class that is able to display a set of places as well as single places. On startup, the application creates an instance of this MapActivity and displays multiple places. If the user clicks on a certain place, then a new Activity is launched that shows the details of the selected place. This activity has a menu item that allows the user to view the place on a map - this causes that a new instance of the MapActivity is created, except that now only this single place is displayed.

The problem now is that if the user navigates back to the first MapActivity (the one that shows multiple places) the tiles won't be loaded anymore + sometimes OutOfMemoryErrors are encountered. According to the Android JavaDocs, it is only possible to have one MapActivity per process. However, I don't want to define my MapActivity as a singleInstance/singleTask, since the user should always be able to navigate back to the first MapActivity that shows multiple places. I have seen that the Google Places app (which has come with Google Map 4.4) for Android uses multiple MapActivity instances. How is this possible?

Android :: How to Use Multiple Map Activities / Views?


Android :: Pros - Cons Of Multiple Activities In An App Vs One Activity - Multiple Views

Aug 16, 2010

Are there design guidelines to help decide if an application with multiple views should be designed with multiple activities or just one activity and control the back button itself.

I've tried both. My most complex applications using one activity per screen. However, now that I'm successfully written an app with just one activity and handling the back button myself, I don't see any compelling reason to use multiple activities. The one activity application is much simpler and more straightforward.

What advantages of multiple activities am I missing?

View 8 Replies View Related

Android :: Use Multiple Activities Or Multiple Content Views

Feb 18, 2010

I'm working on an application using xml layouts.

I wish to know which is better:
1. Use few activities and change its contentview
2. Use an activity for each 'view' needed

If both works, in which case which option would be better?

View 1 Replies View Related

Android :: Activities And Multiple Views

Aug 3, 2010

I start a browser and from the browser,I start a video which occupies only a small part of the screen,say the bottom right corner.

Now the browser will be pushed to the 2nd position in the window order and Video will come to the first position. Is it possible that browser can have the control for active window and receive the key events though the video is the Top Most window.

View 4 Replies View Related

Android :: Multiple Activities Or Switching Views Manually

Jan 15, 2010

I have developed some apps for Android, and this questions stays always:

How should I structure my UI? Should I launch activity after activity and leave the phone to make the "back" button, or should I choose more optimized, but more complex to implement, way with switching manually Views and then manually doing the "Back" button functionality?

View 4 Replies View Related

Android :: Should App's With Multiple Layouts Have Multiple Activities To Handle Each

Jul 1, 2010

I'm planning to develop and app that presents the users with several different screens (of different information).
Was wondering what would be the best way to implement this?

Is it better to have separate XML layouts and an activity to display and allow the user to interact with each screen of data?

OR would handling all of these in the same activity be more efficient (and dynamically load / unload each layout)?

View 2 Replies View Related

Android :: Activities Vs Views

Jul 8, 2010

I am working on an Android app that has multiple screens the user will need to navigate between and I am curious what the best practices are when switching between those screens. I am torn between creating a new Activity for each screen and simply changing the view (setContentView(R.layout.whatever)). The screens all share at least some variable values so I'm leaning toward changing views and using class level variables, but I'm worried a single activity could become very large and confusing with logic for multiple screens in a single file. I'd like to keep the code clean and separated, but I also don't want to be passing several variables around between views if that isn't needed.Being new to Android development, I'm hoping some more experienced members of the community could share their thoughts and let me know how best to handle it

View 2 Replies View Related

Android :: Caching Views And Activities

Apr 24, 2009

I've got a activity showing the user a list of songs to play, and when he opens a song I launch an activity which embed a player.

My problem is that when i finish playing i call "this.finish()", but when the user reopen the player, the "onCreate" is launched and it seems that the GUI is building itself "again".

I've tried to not call "this.finish()" and call the Activity.startActivity on the father, but with this way, when I clic on the "back" button on the emulator, I get all the players playing in the same time (they still exist).

So my question, is there a way to make an activity "a singleton" or to freeze it to be retrieved later (It can't be able to retrieve it with "back" button) or a way to cache all the constructions so to not have to do it again ?

View 2 Replies View Related

Android :: Using Different Activities For Different Views In ViewFlipper

Jul 16, 2010

I am developing a Music Player and I have a view flipper to control all the artist view, album view, so on and so forth. What I am doing now is that I have list view in each view of the view flipper. However, I do not want to put all my codes inside one activity but rather, to have different activities for each view. Is that possible to implement?

View 1 Replies View Related

Android :: Keep Threads And Views Alive Between Activities

Sep 13, 2010

Trying to understand the Android framework model. I have an application that needs to have several threads running. On thread gets GPS fixes, another picks up GPS fixes and pushes them to server, and yet another occasionally polls a server for dispatched orders. Some of these threads update status Views as well.

Since I am new to Android, the application framework model hasn't clicked for me. Where are these threads started? Right now I start the threads in the initial Activity, but if I understand it right, once that Activity goes invisible it is stopped. Furthermore, I have to track GPS and network statistics so that I can have a View which may (or may not) be the active View.

View 1 Replies View Related

Android :: Activities And Views Related In Platform

Jun 10, 2010

I am attempting to learn how to develop on the Android platform but do not quite understand the relationship between Activities and Views, because according to the documentation an Activity is almost always linked to a UI object that the user can interact with, but if this is the case where does the whole idea of Views come in?

View 1 Replies View Related

Android :: Why Add Child Activities To TabActivity Instead Of Simply Using Views

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

Android :: Updating Views Of Sub Activities Of TabActivity From Background Process

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

Android :: Multiple Surface Views

May 20, 2010

I am working on a graphics application in Android. I have a question regarding MULTIPLE SURFACE VIEWS. Can I be rendering multiple surface views at the same time. Initially, when I had two surface views in the same activity, it didn't seem to work, as it used to show only one at any time. But, with one surface view attached to one activity, is there any way I can keep the background activity's Surface View alive so that both the surfaces get rendered together?

View 2 Replies View Related

Android :: FindViewById When Multiple Views Have Same ID

Aug 5, 2009

what would be the outcome of using findViewById when multiple child views have the same ID lets say for example when using a layout to dynamically produce multiples of the same control?

View 4 Replies View Related

Android :: Multiple Views For For Row In ListView

Jan 17, 2010

I have a ListView that could have 4 different views for a row depending on the data for the row. I have the ListView working correctly overriding getViewTypeCount and getItemViewTYpe. I originally was trying to dynamiclly update the view type count as new views were inflated by forcing calls to getViewTypeCount because it was possible that maybe one or two views may be all that would be needed. The app never functioned correctly crashing after there was more than one view added. The problem was fixed by setting getViewTypeCount to always return 4. I noticed getViewTypeCount is automatically called on app start-up and never called again unless a force call is made. So I'm just curious if this can be changed dynamically or do you need to know the number of max views you can possibly have and override getViewTypeCount to return that max value.

View 1 Replies View Related

Android :: Way To Add Multiple Views To A Listview?

Jun 15, 2010

I tried to add these views to list view using this kind of factory but everytime I try and add the view to a ListActivity, it comes up with nothing. What am I doing wrong?

View 3 Replies View Related

Android :: App With Multiple Activities

Feb 8, 2010

I have a very simple game that consists of only one activity, and I want to add a title screen.If the title screen is another activity, what changes do I need to make to my manifest file to make the title screen open first?The gameplay activity is called Leeder, and the title screen activity is called LeederTitleScreen.

View 1 Replies View Related

Android : Switching Between Multiple Views In A ViewFlipper

Jul 19, 2010

I have an application using ListView inside Tabs, and I'd like to switch to a separate View(data collection widget) on clicking an item in the List.I'm adding each List's row's children to a ViewFlipper and the items are added at runtime so there is no definite number of views. As such, i would want to navigate/switch to a particular View in the ViewFlipper.Any pointers?

View 3 Replies View Related

Android :: Run Multiple Activities Simultaneously

Aug 30, 2010

I have buil a file explorer just like a mycomputer.it reads the whole storage and system for files and directories now.i am working with start menu.i have built it in an other activity i wan to make them active at the same time?

View 2 Replies View Related

Android :: Thread In Multiple Activities

Aug 23, 2009

I have started a thread from one Activity and then i have started another activit from parent Activity . Now my Parrent Activity is in pause state . but what will happen to thread that I have started from parrent . I belive it will continue........not going in sleep state........

View 2 Replies View Related

Android :: Multiple Activities In Application

Mar 17, 2010

I seem to be missing something obvious here, why would I want more than one activity per application in Android? Does somebody have some solid examples?

View 3 Replies View Related

Android :: Multiple OpenGL Activities

Mar 18, 2010

I'm having a problem when I create a Sub-Activity to my main activity. Both activities have their own GLSurfaceViews. Nothing on Logcat. Basically It just opens up the new view and it's black and it never renders with the new opengl stuff. I've tried a bunch of stuff, just want to know if there's some special way I need to pause the first opengl activity to get the second to run, or if there's some toggle which I am missing, or if it just can't be done. When I open the second activity with a GLSurface View, the first activity stops drawing frames, but the second one, never initializes or starts to draw.

Main Activity Creation:

CODE:................

View 3 Replies View Related

Android :: Timer Across Multiple Activities

Jun 28, 2010

i have an android app with several activities. I need to start a timer when the first activity starts and end the timer when the last activity starts and show the elapsed time. How can i use Asynctask to do this.

View 2 Replies View Related

Android :: Running Multiple Activities

Jun 23, 2010

I have developed a simple android application, which when started opens a Timer. User is given two buttons, start/ pause. This is working fine.What i want to do is to add a way to support multiple timers when a user swipes his finger on the screen.When he swipes from left to right, a new timer should show up, but the previous timer should not stop. This is a way to add multiple timers.Also, when he swipes from right to left, i want a previous timer to show.This is what i have done so for. I have a timer activity. I have added a touch event on it. When, a person swipes his finger, i get the co-ordinates and decide whether its from left to right or right to left.This functionality is working fine, as i can see the appropriate log messages.The problem is when I'm trying to load Timer Activity.It just loads the previous Activity and doesn't really create a new one (I figured this from the timer).Is there any way to do it?

View 1 Replies View Related

Android :: Use One Object In Multiple Activities Within My App?

May 25, 2010

I need to be able to use one object in multiple activities within my app, and it needs to be the SAME object. What is the best way to do this?

I have tried making the object "public static" so it can be accessed by other activities but for some reason this just isn't cutting it. Are there any other ways of doing this?

View 6 Replies View Related

Android :: Application With Multiple Views - Best Practice For Structure?

Jun 20, 2010

I am new to developing for android. I have a question regarding some best practices. My app is like a dashboard from which multiple different "sub-activities" can be started and done. I am wondering what is the best way to structure the app. One way is to have different layouts and load and unload them appropriately. The other is to start new activities using intents. At least this is what I have gathered from what I have read.

View 3 Replies View Related

Android :: Implement Multiple Views That React To OnTouch?

Oct 10, 2010

Let's say I have MyActivity and inside my onCreate method I initialize MyBackgroundView, then MyPlayer1View then MyPlayer2View. I want to be able to touch the screen, figure out if I have touched Player1 or Player2 and then respond with changes to the players if I have touched them.

My problem is, where do I put the onTouchListener? Can only MyBackgroundView listen for touches, or can the players listen for touches too? If MyBackgroundView can only accept touches, do I need to call view.ontouchlistener that says, you have touched me, and I have a player at those coordinates, so I'll pass the motion event to the player and let it handle it? Or do call view.ontouchlistener in each of the players that says, you've touched me, now I will react to the motion event?

View 1 Replies View Related

Android : Group Of Views Controls On Multiple Screens

Aug 15, 2010

I am working on an Android project where a group of buttons needs to show on the bottom of every screen (activity) in the application. The group of buttons are basically a navigation bar. I want to know the best way to do this without creating new buttons for every activity. I have been around programming (C++/C#) for many years but am pretty new to Android and Java so if someone can point me in a general direction.

View 2 Replies View Related

Android :: Multiple Choice Dialogs - Activities

Apr 26, 2010

I have tried to make a series of dialogs, like a questionnaire, that the user needs to answers a series of questions selecting one or more checkboxes. I can do one, just fine, but when I try to make more than one question (lets say 10), it does not show, or show all the dialogs. I tried using dialogs or new acitivities.

So, my problem is I have multiple questions, one to be presented each time, and I need to wait for one to be responded so I can ask the next one. How do I accomplish this?

My first attempt was with a dialog box... but obviously it got all the boxes stacked in each other:

CODE:.................

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved