next → ← prev Android Activity Lifecycle Android Activity Lifecycle is controlled by 7 methods of android.app.Activity class. The android Activity is the subclass of ContextThemeWrapper class. An activity is the single screen in android. It is like window or frame of Java. By the help of activity, you can place all your UI components or widgets in a single screen. The 7 lifecycle method of Activity describes how activity will behave at different states. Android Activity Lifecycle methods Let's see the 7 lifecycle methods of android activity. Method Description onCreate called when activity is first created. onStart called when activity is becoming visible to the user. onResume called when activity will start interacting with the user. onPause called when activity is not visible to the user. onStop called when activity is no longer visible to the user. onRestart called after your activity is stopped, prior to start. onDestroy called before the activity is destr...
Popular posts from this blog
Display All Contacts from Contacts application in ListView
Display All Contacts from Contacts application in ListView Above output checked in Real Device. xml files under values folder: strings.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Display All Contacts</string> <string name="action_settings">Settings</string> <string name="hello_world">Hello world!</string> <string name="btitle">Load Contacts</string> </resources> xml files under layout folder: activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > ...
Navigation in Android(Explicit Intent)
Navigation in Android(Explicit Intent) An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed. There are two primary forms of intents you will use, They are: Explicit Intent Implicit Intent Explicit Intent: After writing a single Activity, There comes a need to navigate to another activity to perform another task . For this we use Explicit Inents. ScreenShots: activity_main.xml: < RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android" ...
Comments
Post a Comment