Android Scrollable TextView | Vertical Using XML and Programmatically

Making TextView scrollable on Android you need to use a android:scrollbars properties of your TextView in your layout’s XML file. Then use the below code in the Activity file. This method will enable scrolling on TextView. Kotlin

Java

ScrollView is needed when you want to show too long text and should fit into one screen. Read More…


How to make links in a TextView clickable HyperLink on Android Kotlin/Java

To make a TextView clickable(hypertext link) in Android you can do it in value Strings file or calling setMovementMethod(). There are multiple scenarios and conditions. Let’s see some situations which we have found on stack overflow: A. android:autoLink=”web” works if you have full links in your HTML. The following will be highlighted in blue and Read More…


Android status bar color change | android:colorPrimaryDark

Changing the Android status bar color is very easy in Android Studio. Set color on android:colorPrimaryDark the attribute of the style you’re using for your app in styles.xml. Android 5.0 Lollipop introduced Material Design theme which automatically colors the status bar based on the colorPrimaryDark value of the theme. Code

On API level 21+ you can also use the Window.setStatusBarColor() method Read More…


WebViewClient onPageFinished() | listen for a WebView finishing loading a URL

To know about the URL loaded or not in WebView have to use the webViewClient onPageFinished() method. A WebView to have a WebViewClient to make use of the onPageFinished event callback. You should first know about the- What is WebView in Android? 2 main callback methods of WebView Client:- onPageStarted – Page loading started onPageFinished Read More…


Android text underline XML layout | TextView Kotlin/Java

You can define the underlined text in an Android layout XML using a String Resouce XML file. In string res file you have to use an HTML underline tag <u> </u>. Another way is to underline text in TextView android programmatically. String resource XML If you are using a string resource XML file (supports HTML tags), it can be done Read More…


How to Android button rounded corners | Radius, ripple, corners, design?

Do you want to make the corners of a button round in Android? In this tutorial, you will learn an easy way to achieve this in Android. To create an Android button rounded corners have to use a new XML file. This new XML file will be inside a drawable folder. To change the corners of all Read More…


Getting a Result from an Activity| Android startActivityForResult Example Kotlin

Activity in the Android application development, you can do 2-way communication on starting a new Activity. A first Activity can get the result from another Activity. It can be done by call startActivityForResult() method instead of instead of startActivity() method. Build an app to get Result from an Activity using Android startActivityForResult method : Think about Read More…


How to Save UI States | Android Activity State onSaveInstanceState Method – Kotlin

Saving a UI state in the android app is very important, UI state to remain the same, but the system destroys the activity. To improve user experience and handle it system behavior you can use ViewModel object, onSaveInstanceState() method and local storage to persist the UI state across such application. You can use any or combination of Read More…