Sending POST data in Android

Note (Oct 2020): AsyncTask used in the following answer has been deprecated in Android API level 30. Please refer to Official documentation or this blog post for a more updated example Updated (June 2017) Answer which works on Android 6.0+. Thanks to @Rohit Suthar, @Tamis Bolvari and @sudhiskr for the comments. References: https://developer.android.com/reference/java/net/HttpURLConnection.html How to … Read more

Difference between getContext() , getApplicationContext() , getBaseContext() and “this”

View.getContext(): Returns the context the view is currently running in. Usually the currently active Activity. Activity.getApplicationContext(): Returns the context for the entire application (the process all the Activities are running inside of). Use this instead of the current Activity context if you need a context tied to the lifecycle of the entire application, not just … Read more

What exactly does fitsSystemWindows do?

I’m struggling to understand the concept of fitsSystemWindows as depending on the view it does different things. According to the official documentation it’s a Boolean internal attribute to adjust view layout based on system windows such as the status bar. If true, adjusts the padding of this view to leave space for the system windows. … Read more