In this example, we will see how to resolve the error “unresolved reference data binding” error in Kotlin. An unresolved reference error indicates that the compiler is unable to locate the classes and resources associated with data binding. Check gradle…
Programming
In this article, we will see how to call a suspend function from the normal functions in Kotlin. What are suspend functions? Suspend functions executed within the coroutine contexts are used to write asynchronous programming in Kotlin. These functions allow…
By default, the data classes in Kotlin automatically generate the primary construction which takes the parameter of the declared members. This constructor will initialize all the properties at the time of object creation. The primary constructor does not provide an…
In this article, we will see how to generate a random number in the given range using Kotlin. Using random class from Kotlin standard library By using the kotlin.random.Random class from the Kotlin standard library, we can generate a random…
In this article, we will see different methods to get the current timestamp in Kotlin. currentTimeMillis(): By using the system.currentTimeMillis(), we can get the current timestamp in Kotlin. This function returns the current time in milliseconds since January 1, 1970,…
In this article, we will see how to use an AlarmManager class in Kotlin to provide a convenient way to schedule and manage alarms, display notifications, start a service e.t.c First, we need to obtain an instance of the AlarmManager…
In this article, we will see how to programmatically move the cursor to the end of the text in EditText. By default, when the EditText receives focus, the cursor appears at the beginning of the text. For a better user…
In this article, we will see some of the possible reasons for the error “object has no attribute columns“. The error “‘numpy.ndarray’ object has no attribute ‘columns’” usually occurs when trying to access the ‘columns‘ attribute of a NumPy ndarray….
In this article, we will see different ways to perform a case-insensitive comparison in Python. Using the ‘in’ operator in is used to check if the given value is present in the sequence or container. It returns True if the…
In this article, we will see how to use the ellipsis slicing syntax in Python. Before understanding ellipsis slicing, it is important to understand the slicing concept in Python. Slicing is used to extract a portion of an array or…