
StartActivity would add OtherActivity on the activity stack and launch it. val intent = Intent(this, OtherActivity::class.java) In Kotlin, following is the way to create an activity. This falls under the implicit intent category. It’ll display all the available applications of those types. An action such as URL, phone number, location. This type of Intent is an explicit intent. We set the component name which can be: The fully qualified class name of the activity to be called. An intent definition mainly consists of an instance of the current activity. In this tutorial, we’ll be looking mainly at intents to handle activities.
Launch activities from a broadcast receiver.
Starting Fragments/Communicating between fragments.
Starting a new activity and passing some data. Using Parcelable and Serializable to pass objectsĪs the name says Intent is something that’s used to perform some action with respect to the flow of the android application. Overall, ArrayList is a powerful and flexible collection type that is useful in many situations, but it may not always be the best choice depending on the specific requirements of your program.In this tutorial, we’ll be discussing Android Intents and implement them using Kotlin in our application. Iteration performance: When iterating over an ArrayList, accessing elements by index can be slower than using an array, because each element is accessed through a function call rather than direct memory access. Memory usage: ArrayList can use more memory than arrays because it stores each element as an object, which requires additional memory overhead. Overhead: ArrayList has a small amount of overhead compared to arrays, which can affect performance in certain situations. Here are some advantages and disadvantages of using an ArrayList in Kotlin:ĭynamic resizing: Unlike arrays, ArrayList can resize dynamically, which means you can add or remove elements from the list as needed.įlexible storage: ArrayList can store objects of any type, making it useful for storing collections of heterogeneous data.Įasy manipulation: ArrayList provides a variety of methods for adding, removing, and manipulating elements in the list, making it easy to work with. ISRO CS Syllabus for Scientist/Engineer Exam.
ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
DevOps Engineering - Planning to Production. Python Backend Development with Django(Live). Android App Development with Kotlin(Live). Full Stack Development with React & Node JS(Live). Java Programming - Beginner to Advanced. Data Structure & Algorithm-Self Paced(C++/JAVA). Data Structures & Algorithms in JavaScript. Data Structure & Algorithm Classes (Live).