Showing: 11 - 20 of 34 Articles

Generic Recycleview with Adapter in Kotlin

Now I will show you how to use Generic RecycleView for different View Types. First of creating Generic Recycleview Adapter (GenericAdapter) class as below. import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup abstract class GenericAdapter : RecyclerView.Adapter { var listItems: List constructor(listItems: List) { this.listItems …

Access Shared preference data from one application to another application

Create Shared preferece data in first application set its mode to MODE_WORLD_READABLE. Here is a following snippet you can find how to create shared preference and store data into it. mSharedPrefs = getSharedPreferences(“Prefs_First”, MODE_WORLD_READABLE); SharedPreferences.Editor editor = mSharedPrefs.edit(); editor.putString(“name”, etName.getEditableText().toString()); editor.putString(“password”, etPassword.getEditableText().toString()); editor.commit(); In another …

AutoCompleteTextView: Remove soft keyboard on back press instead of suggestions

We can achieve that by override-ing onKeyPreIme in your custom AutoCompleteTextView. public class CustomAutoCompleteTextView extends AutoCompleteTextView { public CustomAutoCompleteTextView(Context context) { super(context); } public CustomAutoCompleteTextView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override …