Android Explicit Intent

The component to be invoked from an activity, the Android Explicit intent is used. Thus, the explicit intent can be used to call another activity in android. The explicit intent is used to pass the information from one activity to another. Example: In the below example, we are demonstrating the usage of the android to … Read more

Android Intent

The message passed between components such as activities, content providers, broadcast receivers, services, etc, is what the Android Intent is. To invoke an activity, broadcast receivers, etc, the startActivity() method is used with the Android Intent. The intent has a simple meaning of intention or purpose, i.e, the intention to do an action. The android.content.Intent … Read more

Activity Lifecycle Android

There are seven methods of android.app.Activity class that controls the Android Activity Lifecycle. The ContextThemeWrapper class has the Android Activity as a subclass. A single screen in android, much like a window or frame of Java is what an activity is. Thus, all the UI components or widgets can be placed on a single screen, … Read more

SearchView on ToolBar Android

Other than the Activity layout, the SearchView widget can also be implemented over ToolBar/ActionBar. Create the menu option and place a SearchView widget on it, to implement the SearchView over ToolBar. Example of SearchView on ToolBar (ActionBar): In the below example, we are demonstrating the SearchView over ToolBar and searching data in ListView. activity_main.xml: In … Read more

EditText with TextWatcher Android

Android EditText with TextWatcher (Searching data from ListView) The TextView class has a subclass named Android EditText which is used for entering and modifying text. The input type must be defined in the inputType property of EditText while using EditText width. It thus configures the keyboard according to the input. To watch the changes made … Read more

SearchView Android

To search queries submitted over the search provider, a user interface is provided by the Android SearchView. The implementation of the SearchView widget can be over a ToolBar/ActionBar or inside a layout. By default, the SearchView in Android is collapsible. The setIconifiedByDefault(true) method of SearchView class is used to set it to be iconified. The … Read more

TabLayout with FrameLayout Android

The TabLayout and FrameLayout are used to create non sliding tabs. By adding the TabItem of android support design widget, we can implement the Items of TabLayout. Example of TabLayout using FrameLayout: In the below example, we are demonstrating the use and behavior of the TabLayout using FrameLayout and Fragment. File: activity_main.xml: In the activity_main.xml … Read more

TabLayout Android

After the deprecation of ActionBar.TabListener (API level 21), the TabLayout is released by Android which is used to implement horizontal tabs. To implement tabs, the TabLayout is introduced in the design support library. The TabLayout class provides the newTab() method to create Tabs. The setText(int) and setIcon(int) methods of the TabListener interface are used to … Read more

ViewStub Android

To load “layout resource” at runtime, the ViewStub is used in Android. It is a zero-sized invisible View. We can not see anything on the layout pallet because it is a zero dimension View. The inflate() method is invoked to make the parent resource visible. The setVisibility(int) method is invoked to make ViewStub visible or … Read more

Image Switcher Android

The feature to facilitate an animation over images to transition from one image to another is provided by the image switcher in Android. The ImageSwitcher component needs to be implemented in the XML file, to use the image switcher. To provide an implementation of the ViewFactory interface, the setFactory() method of ImageSwitcher is used. Its … Read more