Short cuts

Android Released Date features Activity Android Life Cycle Life Cycle of Activity ANDROID Version Micromax layout onCreate() onPause() onResume() onStart() Android 4.3 Android 4.3. Android One Android One smartphone Jelly Bean Life Cycle Moto X Nexus 7 Versions its Features latest Android 4.3 leak layout parameters onDestroy() onStop() 5G technology A new touchscreen display AT&T Android 4.4 KitKat release date Android. Apple Apple iPhone 5S Apple's iPhone 5 Battery CGL Canvas Nitro A310 smartphone HTC One Mini Huawei Technologies Layout Types Lenovo S5000 Mi3 Micromax Android One Moto 360 Moto G Moto G2 Online Payment Service SSC SSC CGL 2016 SSC CGL Apply online SSC CGL Notification SSC CGL important dates SSC CGL syllabus Samsung Samsung Tags:Galaxy Gear States T-Mobile Table Layout Tablets Verizon Visa Checkout Visa credit Wall Street Journal absolute layout airtel airtel entertainment android application development android gaming system android layouts android questions android rooting bundle debit cards developers facebook services finish() how to write android program iOS iPhone 5 identifying fingerprints indian developers installing interview questions on android for fresher iphone jailbreaking kitkat version libraries linear layout linux microsoft microsoft portal news note 8 pro nvidia online purchase operating system passport through smartphone redmi redmi note 8pro redmi note 8 redmi note 8 pro price redmi note8 pro specifiactions relative layout rooting run android application screen orientation smartwatch view

Friday 19 July 2013

android : Managing the Activity Lifecycle

Managing the Activity Lifecycle


As a user navigates through, out of, and back to your app, the Activity instances in your app transition between different states in their lifecycle. For instance, when your activity starts for the first time, it comes to the foreground of the system and receives user focus. During this process, the Android system calls a series of lifecycle methods on the activity in which you set up the user interface and other components. If the user performs an action that starts another activity or switches to another app, the system calls another set of lifecycle methods on your activity as it moves into the background (where the activity is no longer visible, but the instance and its state remains intact).
Within the lifecycle callback methods, you can declare how your activity behaves when the user leaves and re-enters the activity. For example, if you're building a streaming video player, you might pause the video and terminate the network connection when the user switches to another app. When the user returns, you can reconnect to the network and allow the user to resume the video from the same spot.
This class explains important lifecycle callback methods that each Activity instance receives and how you can use them so your activity does what the user expects and does not consume system resources when your activity doesn't need them.
  • Starting an Activity
  • Pausing and Resuming an Activity
  • Stopping and Restarting an Activity
  • Recreating an Activity


Starting an Activity:
Learn the basics about the activity lifecycle, how the user can launch your app, and how to perform basic activity creation.
Pausing and Resuming an Activity:
Learn what happens when your activity is paused (partially obscured) and resumed and what you should do during these state changes.
Stopping and Restarting an Activity:
Learn what happens when the user completely leaves your activity and returns to it.
Recreating an Activity:
Learn what happens when your activity is destroyed and how you can rebuild the activity state when necessary.

No comments:

Post a Comment