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?

Android :: use multiple activities or multiple content 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 :: 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 :: 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?

View 1 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 :: 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 :: 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 :: 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 : 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 :: 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

Android :: Multiple Activities Binding To A Service

Aug 3, 2010

I have a service component (common task for all my apps), which can be invoked by any of the apps. I am trying to access the service object from the all activities, I noticed that the one which created the service [startService(intent)] has the right informaion. But rest does not get the informaion needed.

My Code is as below:

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

If I invoke startService(intent). it creates a new service and runs in parallel to the other service.

If I don't invoke startService(intent), serviceObj.getData() retuns null value.

View 1 Replies View Related

Android :: Service Interacting With Multiple Activities

Jun 29, 2010

I'm trying to refactor/redesign an Android app. Currently, I've one UI activity (Activity 1) that creates a DataThread. This thread is responsible for network I/O and interacts (provides data) with the UI activity via a handler.

Now, I want to add another activity (a new UI screen with Video) - Activity 2. Activity 1 is still the main activity. Activity 2 will be invoked when the user clicks a button on Activity 1. Activity 2's data also comes from the DataThread.

My idea is to put the logic of my DataThread inside an Android Service (DataService). My question is - can more than on activity bind to my DataService at the same time? Is there a way to tell the service to provide data to a specific activity only?

View 1 Replies View Related

Android :: Want Multiple Activities In A Single View

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

Android :: Displaying Multiple Activities On Same Screen

Mar 25, 2010

is it possible to show two activies on same screen at a time.and each activity is showing data which changes with time.

View 1 Replies View Related

Android :: How To Test Phone App Across Multiple Activities?

Nov 18, 2009

We are building a complex Android application consisting of many screens and workflows spread across many Activities. Our workflows are similar to what you might see on a Bank's ATM machine, for example, there is an Activity to login in that transitions to a main menu Activity which can transition to other activities based on the user's choices. Since we have so many workflows we need to create automated tests that span multiple activities so we can test a workflow from end to end. For example, using the ATM example, we would want to enter a valid PIN, verify that sends us to the main menu, choose withdraw cash, verify that we are on the withdraw cash screen, etc., etc., and eventually find ourselves back on the main menu or "logged" out. We've toyed with the test APIs that come with Android (e.g. ActivityInstrumentationTestCase2) and also with Positron, but neither seem capable of testing beyond the bounds of a single Activity, and while we can find some utility in these tools for some unit testing, they won't meet our needs for testing scenarios that cut across multiple Activities. We are open to an xUnit framework, scripting, GUI recorders/playbacks, etc. and would appreciate any advice.

View 9 Replies View Related

Android :: Make Variables And Multiple Activities?

Oct 12, 2010

How can I make a variable or object available to multiple activities or restarts of the same one.

View 1 Replies View Related

Android :: Showing Multiple Activities On One Screen

Sep 30, 2010

I have an interesting problem and I was looking for a solution; Hoping that someone here can help me out.(I did read through related questions on this topic but they have solutions which are not relevant to my situation).I have two activities. One is a simple list view to list available audio tracks. Another is a complex audio toolbar with controls to play/pause, ffd, and reviewing the currently playing audio.The audio toolbar uses a wrapper class that wraps the Android MediaPlayer object and this wrapper class is a singleton object. Which means that I eventually wish to use the audio toolbar anywhere in my app and control the singleton instance of my MediaPlayer wrapper.For this reason, I cannot have the audio toolbar and the audio listview in the same activity since I want the toolbar to be a separate entity altogether that pops up whenever the user wants to control the music, without having to see the listview.Now, since the user would pop up the toolbar from anywhere in the app, I would love to know of a way to combine the current activity and the toolbar activity into one screen.I do know that one option available to me is dialogs. I was looking for a more elegant solution where I could have the audio toolbar pop up at the bottom of the screen the user is on, without exiting the activity he is currently doing.Anyone know of a way to do this? I didn't come across anything for this in the docs but if someone does know, even pointing me to the correct docs would be extremely useful.

View 2 Replies View Related

Android :: Running Multiple Activities In For Loop One After Other

Oct 1, 2010

I have multiple activities in my android app and one final activity "All" which should run all the activities of my app one after the other. When I kept all my activities in for loop and used startactivity(intent) for each activity in that for loop, at the end I could see not all my activities being ran although all activities are finished. Any clue how to implement this?

View 3 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







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