[android-developers] Re: Handler().postDelayed() question
Can you show me an example ??? Please On 1 dez, 13:12, JBirdVegas jbirdve...@gmail.com wrote: Works like a dream. Thanks Mark! On Dec 1, 7:34 am, Mark Murphy mmur...@commonsware.com wrote: On Wed, Nov 30, 2011 at 3:26 PM, JBirdVegas jbirdve...@gmail.com wrote: Ok I'm working on a splash screen that pauses for 1.5 seconds and works great, except for one thing. Once the timer is started in onCreate if the configuration (orientation) changes then the timer gets reset and then end result is it starts my ParchmentActivity.java twice. How can I prevent the handler from sending the intent twice? If savedInstanceState is null in onCreate(), schedule your Runnable, otherwise, do not. The savedInstanceState parameter will be non-null if your activity is being created as a result of a configuration change. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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] Re: Handler().postDelayed() question
Can you show an example? On 1 dez, 13:12, JBirdVegas jbirdve...@gmail.com wrote: Works like a dream. Thanks Mark! On Dec 1, 7:34 am, Mark Murphy mmur...@commonsware.com wrote: On Wed, Nov 30, 2011 at 3:26 PM, JBirdVegas jbirdve...@gmail.com wrote: Ok I'm working on a splash screen that pauses for 1.5 seconds and works great, except for one thing. Once the timer is started in onCreate if the configuration (orientation) changes then the timer gets reset and then end result is it starts my ParchmentActivity.java twice. How can I prevent the handler from sending the intent twice? If savedInstanceState is null in onCreate(), schedule your Runnable, otherwise, do not. The savedInstanceState parameter will be non-null if your activity is being created as a result of a configuration change. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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] Re: Handler().postDelayed() question
Works like a dream. Thanks Mark! On Dec 1, 7:34 am, Mark Murphy mmur...@commonsware.com wrote: On Wed, Nov 30, 2011 at 3:26 PM, JBirdVegas jbirdve...@gmail.com wrote: Ok I'm working on a splash screen that pauses for 1.5 seconds and works great, except for one thing. Once the timer is started in onCreate if the configuration (orientation) changes then the timer gets reset and then end result is it starts my ParchmentActivity.java twice. How can I prevent the handler from sending the intent twice? If savedInstanceState is null in onCreate(), schedule your Runnable, otherwise, do not. The savedInstanceState parameter will be non-null if your activity is being created as a result of a configuration change. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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