Skip to content

Instantly share code, notes, and snippets.

@crysxd
crysxd / ExampleActivity.java
Last active February 8, 2019 13:13
Requesting Android M 6.0 permission with couple of lines
...
public class ExampleActivity extends AppCompatActivity {
public void onClick(View v) {
// This example shows how to request CALL_PHONE and READ_CALENDAR and do some stuff with the permissions
// The user will only be prompted for the permissions he not yet has granted
new PermissionRequestManager()
@rishabhmhjn
rishabhmhjn / LoadMoreListView.java
Last active December 18, 2017 08:08
Custom ListView for use case such as endless scrolling
package me.rishabhmhjn.widgets;
import me.rishabhmhjn.R; // might be diffrent for your use
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;