Skip to content

Instantly share code, notes, and snippets.

Pat Lackemacher plackemacher

Block or report user

Report or block plackemacher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@plackemacher
plackemacher / BaseTest.java
Created Sep 30, 2015
Robolectric Activity Leak Fix
View BaseTest.java
@SuppressLint("NewApi")
@After
public void resetWindowManager() {
Class clazz = ReflectionHelpers.loadClass(getClass().getClassLoader(), "android.view.WindowManagerGlobal");
Object instance = ReflectionHelpers.callStaticMethod(clazz, "getInstance");
// We essentially duplicate what's in {@link WindowManagerGlobal#closeAll} with what's below.
// The closeAll method has a bit of a bug where it's iterating through the "roots" but
// bases the number of objects to iterate through by the number of "views." This can result in
// an {@link java.lang.IndexOutOfBoundsException} being thrown.
View keybase.md

Keybase proof

I hereby claim:

  • I am plackemacher on github.
  • I am plackemacher (https://keybase.io/plackemacher) on keybase.
  • I have a public key whose fingerprint is 8BEB 7688 A0AA D801 5D10 B7FE 6D77 43DD 782C C4CE

To claim this, I am signing this object:

@plackemacher
plackemacher / gist:753c72de590d4cf06a5e
Created Jun 27, 2014
TestFairy Gradle exception in Android Studio
View gist:753c72de590d4cf06a5e
Caused by: org.gradle.api.GradleException: Could not locate zipalign, please validate 'buildToolsVersion' settings
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
You can’t perform that action at this time.