Android :: Program Flow When Rotating Device With Two Activities
Aug 13, 2010
My first activity is creating a second activity within its onCreate:
CODE:............
The second activity has EditText views for the username and password along with submit and cancel buttons. When either button is pushed, the text from username and password is sent back to activity one (via onActivityResult), which connects to a server to see if the username is available. While connecting to the server showDialog is used to show a ProgressDialog. When the server responds, the ProgressDialog is dismissed and an AlertDialog is shown. This works fine as long as the device is not rotated.
Here's the problem: if the user rotates the device from within the second activity and pushes submit, the first activity re-invokes its onCreate, which ends up launching the second activity again since the username and password are still null.
Does anyone have any suggestions to get around this?
Is there a method that could be used to pass data from activity-2 to activity-1's onCreate? I wouldn't want to use a database in this case, as that seems like overkill.
I've thought about containing the server communication and dialogs to activity 2, but then I'd have duplicate server code in activity 1 and activity 2 (activity 1 connects to the server for other things too). Another issue I'd have with this approach is that the user has an option to cancel creating the password, in which case I want the app to finish. If I called finish from activity 2, activity 1 would appear and I don't want that to show unless a username and password have been created.
It just occurred to me - if I could replace activity 2 with a dialog it might make things simpler. The dialog view needs to have 2 EditTexts and 2 buttons. Can I create something like this and use the showDialog method?
View 1 Replies
Jun 9, 2009
I'm using the 1.5 SDK. I read in 1.0 that rotating the device would cause onCreate() to be called in our apps (possibly recreating the entire app?). Is there a way to test rotating the device in the emulator? I just want to see what happens, I don't have a device to test this. Will the behavior be the same for 1.5 as it was in 1.0?
View 3 Replies
View Related
May 6, 2010
My wish is to know how I can program a mobile website, that fit to all mobile phones.
Are there any special approaches to recognize a device and render the code according to it?
Which tools and coding languages are required?
My first thought was to hold the website in XML, which would be parsed depending on the device.
You have to consider old phones, even devices with only wap support.
For example: The mobile website has to recognize Nokia N75 and render/send the code that looks optimal for this device. Same thing with an iPhone or a Motorola Razr.
View 6 Replies
View Related
Jun 23, 2010
Can we view the database of Emails on Device through DDMS ? How ever i can see and access the database of SMS on Emulator through DDMS.
View 2 Replies
View Related
Feb 21, 2010
I have noticed that some apk's that cost money on android market are available to download from some torrent sites for free. I don't think many of the developers here enjoys that very much. So my question is if there are ways in Android to get around this so that you can't copy a program from device to device?
View 3 Replies
View Related
Aug 11, 2010
Is there any unique id on Android Mobile?? If it is then how many digit it has?
How can I access that through my program?
View 2 Replies
View Related
Dec 13, 2013
I've recently been informed that I'm getting a 2013 nexus 7 for Christmas (Booya!) and I use a MacBook Pro with iTunes. What's the best way to sync my iTunes with my Nexus?
View 2 Replies
View Related
Mar 24, 2010
I run a program on my computer called HP Tuners that is used to datalog and tune gm vehicles. It has become a major pain carrying my laptop everywhere I go just to have the battery run out while im tuning. So what I am wondering is if there is any way that this software can be setup to run on my Sprint HTC Hero?
View 6 Replies
View Related
Mar 9, 2010
Does anyone know if the Nexus One that Google is sending developers as part of the Device Seeding Program is different from the ones people get when they order them from Google's website?
Different packaging? Different firmware? Different pattern on the case?
View 10 Replies
View Related
Jul 16, 2010
By "Program", I mean a desktop front end for installing/uninstalling apps on a phone.Can u please help me out from this? I am not clear what to do ?
View 1 Replies
View Related
May 26, 2010
I am assuming no-one is going to send me Froyo OTA so where can I get a copy of Froyo to flash onto my Nexus One? As I use it for testing my apps I want it to be as close as possible to what a user would have and definitley do not want to root the phone.
View 8 Replies
View Related
Mar 2, 2010
I just received an email about Device Seeding Program for Top Android Market Developers:
Subject: Device Seeding Program for Top Android Market Developers From: android-market-seed...@google.com
Due to your contribution to the success of Android Market, we would like to present you with a brand new Android device as part of our developer device seeding program. You are receiving this message because you're one of the top developers in Android Market with one or more of your applications having a 3.5 star or higher rating and more than 5,000 unique downloads.
In order to receive this device, you must click through to this site, read the terms and conditions of the offer and fill out the registration form to give us your current mailing address so that we can ship your device.
You will receive either a Verizon Droid by Motorola or a Nexus One. Developers with mailing addresses in the US will receive either a Droid or Nexus one, based on random distribution. Developers from Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland, Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers with mailing addresses in countries not listed above will not receive a phone since these phones are not certified to be used in other countries.
View 1 Replies
View Related
Mar 25, 2010
I (as well as many others) received an email telling us that Google would like to give us a new Android device for "your contribution to the success of Android's community forums". The email continued asking us to fill out the form by Monday, March 15th, 6pm PST.
I filled out the form as soon as the email hit my inbox (long before the due date) and have still not heard anything back from them (10 days after the due date). Has anyone else heard anything back about this?
This isn't the "Device Seeding Program for Top Android Market Developers" but the "Android Developer Device Seeding Program" that I'm talking about here.
View 9 Replies
View Related
Jul 15, 2010
I want to write a program which can install and uninstall an application over android device.As these features are provided over android device,but from where should i start and which files are required to be seen to develop my own application.
View 1 Replies
View Related
Dec 13, 2011
Actually I am checking the code flow of NFC in Android-ICS.But i got stuck because of some files are not present in ICS.
Like :
GB code -> WriteTagActivity (to write into a TAG)
ICS code -> no files.
Some more files are also missing in NFC and TAG.
View 2 Replies
View Related
Nov 2, 2010
Had a read through the android documentation on WifiManager and thought I understood it but when I tried to code an example I keep running into problems.
I had the following code
CODE:...........
I had tried something similar to turn off sound
CODE:...............
This works fine, but the wifi part always gives an error, was just wondering if I'm missing something obvious as I can't seem to work it out?
View 2 Replies
View Related
Feb 9, 2010
In android, can you please tell me if there is a way to layout text around an image? Like this: ------ text text text | | text text text ----- text text text text text text text text text text text?
View 3 Replies
View Related
Jan 11, 2010
the app I'm trying to implement allows the user to select a sound file (MP3 or WAV) to play at a specific date and time showing a dialog with a progress bar and an OK/Cancel button allowing the user to stop the playing of the sound file. I want it to behave something like the countdown apps I've seen or even the built-in alarm clock app. As I'm implementing this simple (I thought!) app, I'm trying to better understand the platform and make the application conform to the Android way.
As I've been writing the app, I learn more about how things are supposed to work on the Android platform. And here's where I'm getting a bit confused. During my attempts to get the alarm to fire and display, I'm learning that properly formed Android applications are not supposed to show dialogs as a result of a background service or broadcast receiver being invoked through Android's alarm service. Instead, I think, the app is supposed to use a notification on the status bar to alert the user. The user then has the option to look at the notification to see what the app is trying to tell them..............
View 1 Replies
View Related
Feb 3, 2010
I think that I've found the problem I am having with AccountManager that I described in an earlier thread that got no responses on the board.
I think it is a problem with the way that the Activity Stack is working during the OAUTH workflow. Here's the workflow as I see it. I found this problem by separating out my Activity, which I'll call M, from the oauth Activity, which I'll call O. In the course of authentication, the web browser is invoked and let's call that B.
When a user needs to start over with authentication, my application, through Activity M, starts Activity O. That, in turn, generates some magic URL that is sent to the web browser. So the browser is fired up and information was sent to the OAUTH provider to do a redirect back through the browser back to Activity O.
So, this how the OAUTH workflow looks up to the browser: M -> O -> B
At this point the user logs in and hits the Accept button and the browser then invokes my BROWSABLE activity, which, again, is O. I had thought this would unwind the above stack, but it seems that above situation disappears and what I have after the user hits Accept in the browser is this: B -> O
What I did to work around that is that I put a startActity(M) in O and that seems to work, but it is a workaround.
I believe there is something that I could do with launch modes or activity modes to fix this problem and maintain the original activity stack.
All that is happening, really, is that the O activity pauses for little while, then comes back with the goods, the login credentials. But when I tried to return the information via startActivityForResult (), nothing. Because M is no longer on the Activity Stack.
View 2 Replies
View Related
Feb 12, 2010
Can you please tell me if there is a way to layout textaround an image?I have gotten a response from an android developer about this question. But I am not sure what he means by doing my own version of TextView? Thank for any tips.This is not possible using only the supplied widgets and layouts. could write your own version of TextView to do this, it shouldn't be hard.
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
Apr 9, 2010
Does anyone know if the Android Developer Device Seeding Program is over? Was it only applications that had 5k+ downloads a 3.5* rating in March? I recently published my first app to the market and in 2 weeks it has reached 5k+ downloads and has a 4* rating.
View 2 Replies
View Related
Oct 7, 2010
I'm seeing that it would be good to have some sort of charting scheme (or possibly just a table-based design strategy) when designing Android apps.Have any such schemes been proposed?
View 4 Replies
View Related
Jul 14, 2009
I need two activities run in different processes in the same application. Now I have made it work by specifying the different process name in "android:process". But I met a problem, from http://developer.android.com/guide/topics/manifest/application-elemen..., we have only one superclass of Application will run before the activity starts(I have tested it, and each time a after new processes start, this Application(its superclass) will run before activity). But, my two activities have two different superclasses of Applications.
So, how to make Applications for different activities run for its corresponding activity? If there is no way to use different Application class for different activity, how can I make a flag for the common Application superclass to judge which process(by getting its name) is running? BTW, the two activities were on the separated development flow and I am trying to merge them.
View 12 Replies
View Related
Oct 4, 2010
My activity has a set of buttons on the left half of the screen and a ListView on the right.Initially the focus is on the first button. When I browse the buttons by pressing DOWN arrow key and then press the RIGHT arrow key, the focus does not go to the topmost list item. Instead, the list item correspondingly on the right gets focused.Is there a way that when I press the RIGHT arrow key, the focus goes to the topmost item on the Listview?
View 1 Replies
View Related
May 14, 2010
Will there be any cover flow on the evo and will you be be able to use the music player in landscape mode. I asked this a previous thread figure I would bring it back up.
View 4 Replies
View Related
Aug 30, 2010
I'm using Rotating Progress Bar in my Android Music Plyer Application....I'm not able to stop it. While working with horizontal Progress bar i used handler to stop and start it. But while working with Rotating One, The progress bar goes into Infinite Loop..
View 2 Replies
View Related
Nov 9, 2009
Does anyone know if there is a way turn off the text flow in the Hero's browser? I hate how when I pinch to zoom, it auto text flows and throws me onto some random place on the site...pretty annoying. I have to then search around for where i on the site I was before I did the pinchzoom
View 1 Replies
View Related
Aug 2, 2012
New to Android and to Dolphin Browser HD. I've Googled for days, however, I have come up with squat.
1) When I open a new tab, can it automatically go to my homepage and not the "Speed Dial" sort of page it does now? Any add-ons that might enable this?
2) Does Dolphin Browser HD do automatic text reflow? And, if not, any other browsers that can do this? It is pretty tedious now trying to read pages that aren't re-sized for mobile.
View 3 Replies
View Related
Feb 25, 2010
How can i rotate a view and keep it like that. I have tried the Animation method discuss in the following discussion thread.
http://groups.google.com/group/android-developers/browse_thread/threa...
this works fine for the animation, but it does not handle the key press events itself.my requirement is simple, I need to show a text on a button upside down. Somewhat as if the parent view is drawn landscape and button is portrait.
View 2 Replies
View Related