Download the New LearnVern Android App and enter Lucky Draw to win Free Certificate
If you are facing any issue in playing video please use Firefox browser.
Now we will see what are Widget in Android and how it works.
There are Four types of Widgets in Android Studio.
The first widget in android is the information widget. Its task is to display information in short. It has the work of displaying things directly on the screen without using any different application, such as Weather, Time, etc...
The second widget in Android is the Collection Widget, which is a special kind of collection that helps us to display similar elements, like in our phone gallery, we have a different collection of pictures, or else in our email, we can collectively view all emails together in that single application.
Collection Widgets can scroll vertically and Collection widgets typically focus on two use cases -
The next Widget in Android is Control Widget. In spite of going in a particular application, we can also use it by scrolling on our screen, for example, Wifi.
We can call Hybrid Widget a combination of different elements. For example, the music application where we are also using the music widget and the song is also playing, and in this, we can also keep the information of which song we are playing. So in this way, it is a combination of elements.
Intents are used to move from activity to activity intent describes what the application wants to do consists of –
It provides runtime binding between the code in different applications. They are basically used to :
An intent object is a bundle of informations which is used by the component that receives the intent as well as the information used by the Android System.
Basically there are two types of intents objects . Here below mentions are Intents.
Types of Android Intents Object-
Simply said, when we want to use some readymade code in our application, then we will use implicit intent.
For example: Following code to view the webpage.
When we want to apply some user defined thing in our application, then we will use Explicit intent.
For example: Suppose if you want to connect one activity to another activity, we can do this quote by explicit intent.
Intent i = new Intent(FirstActivity.this, SecondActivity.class);
It will not be wrong if we say, a Fragment is a kind of sub-activity.
Meaning that as soon as the activity life cycle goes on, the life cycle of the fragment will run accordingly.
Fragments were added to the Android API in Honeycomb version of Android which is API version 11.
Have a friend to whom you would want to share this course?