How to implement Android Pull-to-Refresh

Finally, Google released an official version of the pull-to-refresh library! It is called SwipeRefreshLayout, inside the support library, and the documentation is here: Add SwipeRefreshLayout as a parent of view which will be treated as a pull to refresh the layout. (I took ListView as an example, it can be any View like LinearLayout, ScrollView … Read more

How to lazy load images in ListView in Android

Here’s what I created to hold the images that my app is currently displaying. Please note that the “Log” object in use here is my custom wrapper around the final Log class inside Android. package com.wilson.android.library; /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file … Read more

How to stop EditText from gaining focus when an activity starts in Android?

Adding the tags android:focusableInTouchMode=”true” and android:focusable=”true” to the parent layout (e.g. LinearLayout or ConstraintLayout) like in the following example, will fix the problem. <!– Dummy item to prevent AutoCompleteTextView from receiving focus –> <LinearLayout android:focusable=”true” android:focusableInTouchMode=”true” android:layout_width=”0px” android:layout_height=”0px”/> <!– :nextFocusUp and :nextFocusLeft have been set to the id of this component to prevent the dummy … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)