In this tutorial i’m going to show you four different ways to get current date in android. Note : For doing this we will use Calendar, Date, SimpleDateFormate and System class. Method (1) This is a first method and in this method we’ll use Calendar and SimpleDateFormate class. Method (2) This is a second method […]
Category: Android Tips
5 Android App Development Fundamentals for Beginners
The cool features that come along with apps are what draw the interests of users. Apps make phones “smart” and through their benefits, apps have drastically transformed how we function today. Adept programmers are getting busy, designing and building apps of their own and embedding them with favorable features. If you’re one of those enthusiasts, […]
How to clear all activity stack in Androidx
Normally when we launch new activity, it’s previous activities will be kept in a queue like a stack of activities. So if you want to kill all the previous activities, just follow these methods. Method:- 1 In API level 11 or greater, use FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_NEW_TASK flag on Intent to clear all the activity stack.
How to detect Android Back button press.
Detecting android device hardware back button / soft back button press is very easy. But be careful while overriding the default back button action as it is not suggested to change the android default user experience. Method:- 1 Override the onBackPressed() method and take the action inside this function.
How to capitalize every first letter of a word in Android EditText ?
If you want to capitalise the first letter of every word in a EditText, assign android:inputType=”textCapWords” to EditText. Example: The same can be done programmatically also as shown below.