Skip to content

Instantly share code, notes, and snippets.

@jnagels
jnagels / CorrectChildDrawingViewPager.java
Created August 21, 2015 08:57
ViewPager that draws the children in the correct order
package android.support.v4.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@jnagels
jnagels / AbstractActivity.java
Last active January 30, 2018 05:44
StartActivityForResult with nested Fragments
public abstract class AbstractActivity extends FragmentActivity implements FragmentUtils.ActivityForResultStarter
{
private SparseArray<Bundle> requests;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null)
@jnagels
jnagels / AndroidManifest.xml
Created January 6, 2014 10:01
Building with Android Gradle Plugin 0.7.+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<!-- {packagename} will be replaced by the actual packagename -->
<!-- Custom permission to safely send broadcasts between processes -->
<permission
android:name="{packagename}.permission.RECEIVE_BROADCASTS"
android:protectionLevel="signature"/>