Re: [android-developers] two questions from a newbie
- Original Message - From: Mark Murphy mmur...@commonsware.com To: android-developers@googlegroups.com Sent: Thursday, June 09, 2011 1:38 AM Subject: Re: [android-developers] two questions from a newbie On Wed, Jun 8, 2011 at 8:30 PM, Knutsford Software i...@knutsford-software.co.uk wrote: Sorry - what do you mean by stuff the form contents into the Bundle http://developer.android.com/guide/topics/fundamentals/activities.html#SavingActivityState Thanks For part two I meant if you have been browsng and then it loses focus then you resume it you I presume can't pick up the url you had browsed to - you have to start from scratch? You were not browsing -- the user was. You do not have a way to know where the user went in a browser, for obvious privacy reasons. If you need that level of control, embed a WebView into an activity. -- That's ok. I though so but though I had better check incase I was wrong Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] two questions from a newbie
I have a couple of questions 1) If you have a form in in app what do you do if the app goes into the background while you are in the middle of completing the form? Do you need to do something in OnResume or will it resume in the state that you left it in before it went into the background? 2) If you have something like Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(uri)); startActivity(i); in OnCreate what do you do about OnResume so that the browser is pointing to where it was when it was left or do you have to start it again Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] two questions from a newbie
On Wed, Jun 8, 2011 at 6:14 PM, Knutsford Software i...@knutsford-software.co.uk wrote: 1) If you have a form in in app what do you do if the app goes into the background while you are in the middle of completing the form? Do you need to do something in OnResume or will it resume in the state that you left it in before it went into the background? At minimum, when onSaveInstanceState() is called, stuff the form contents into the Bundle, at least for widgets where that is not handled automatically. You may also consider whether you should persist the form contents to a temporary file or something, in case your activity is destroyed before the user comes back to it. 2) If you have something like Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(uri)); startActivity(i); in OnCreate what do you do about OnResume so that the browser is pointing to where it was when it was left or do you have to start it again I'm sorry, but I don't follow this part at all. If you call startActivity() on a URL, the default browser will display that URL. Period. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.0 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] two questions from a newbie
- Original Message - From: Mark Murphy mmur...@commonsware.com To: android-developers@googlegroups.com Sent: Wednesday, June 08, 2011 11:24 PM Subject: Re: [android-developers] two questions from a newbie On Wed, Jun 8, 2011 at 6:14 PM, Knutsford Software i...@knutsford-software.co.uk wrote: 1) If you have a form in in app what do you do if the app goes into the background while you are in the middle of completing the form? Do you need to do something in OnResume or will it resume in the state that you left it in before it went into the background? At minimum, when onSaveInstanceState() is called, stuff the form contents into the Bundle, at least for widgets where that is not handled automatically. You may also consider whether you should persist the form contents to a temporary file or something, in case your activity is destroyed before the user comes back to it. 2) If you have something like Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(uri)); startActivity(i); in OnCreate what do you do about OnResume so that the browser is pointing to where it was when it was left or do you have to start it again I'm sorry, but I don't follow this part at all. If you call startActivity() on a URL, the default browser will display that URL. Period. Sorry - what do you mean by stuff the form contents into the Bundle For part two I meant if you have been browsng and then it loses focus then you resume it you I presume can't pick up the url you had browsed to - you have to start from scratch? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] two questions from a newbie
On Wed, Jun 8, 2011 at 8:30 PM, Knutsford Software i...@knutsford-software.co.uk wrote: Sorry - what do you mean by stuff the form contents into the Bundle http://developer.android.com/guide/topics/fundamentals/activities.html#SavingActivityState For part two I meant if you have been browsng and then it loses focus then you resume it you I presume can't pick up the url you had browsed to - you have to start from scratch? You were not browsing -- the user was. You do not have a way to know where the user went in a browser, for obvious privacy reasons. If you need that level of control, embed a WebView into an activity. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.0 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en