Skip to content

Instantly share code, notes, and snippets.

Dogesmith /
Last active January 31, 2022 12:35
Android Multi-line EditText which prevents newline characters from being added
mContent = (EditText) v.findViewById(;
mContent.setImeActionLabel(getResources().getString(R.string.done), EditorInfo.IME_ACTION_DONE);
mContent.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (event == null) {
lorenzos /
Last active March 30, 2019 21:00
Captures screen from Android device via ADB and makes a 180x320 GIF
# How to install:
# exo-open ""
# sudo apt-get install libav-tools imagemagick
# wget
# chmod a+x
# Help message
function usage() {
gabrielemariotti /
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (

This is a porting of the class SimpleSectionedListAdapter provided by Google



chrisbanes /
Last active March 15, 2024 06:39
* Copyright 2014 Chris Banes
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
Antarix /
Created December 26, 2013 08:31
Simple Example of using LocalBroadcastManager in Android
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;