Skip to content

Instantly share code, notes, and snippets.

View robUx4's full-sized avatar

Steve Lhomme robUx4

View GitHub Profile
@robUx4
robUx4 / gist:7464327
Created November 14, 2013 10:01
AppCompat crash in 2.3.6
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131230783, class android.support.v7.internal.view.menu.ExpandedMenuView) with Adapter(class android.support.v7.internal.view.menu.MenuAdapter)]
at android.widget.ListView.layoutChildren(ListView.java:1535)
at android.widget.AbsListView.onTouchModeChanged(AbsListView.java:2257)
at android.view.ViewTreeObserver.dispatchOnTouchModeChanged(ViewTreeObserver.java:591)
at android.view.ViewRoot.ensureTouchModeLocally(ViewRoot.java:2194)
at android.view.ViewRoot.performTraversals(ViewRoot.java:896)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1949)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3691)
@robUx4
robUx4 / gist:7464399
Created November 14, 2013 10:06
AppCompat crash in HoneyComb (3.1 and 3.2 at least). No idea in what context, it may be in some dialogs. Maybe showing the context to know which activity is wrong could help.
java.lang.IllegalStateException: ActionBarView can only be used with android:layout_width="MATCH_PARENT" (or fill_parent)
at android.support.v7.internal.widget.ActionBarView.onMeasure(SourceFile:840)
at android.view.View.measure(View.java:10828)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:267)
at android.support.v7.internal.widget.ActionBarContainer.onMeasure(SourceFile:233)
at android.view.View.measure(View.java:10828)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:613)
@robUx4
robUx4 / gist:7464455
Created November 14, 2013 10:12
ABS Theme issue with an Activity during a "panel" operation. For some reason the Activity has no ActionBar at this point, maybe it's destroyed ? The crash only occurs on Nexus 7 with 4.3 so far.
java.lang.NullPointerException
at android.support.v7.app.ActionBarImplICS.getThemedContext(SourceFile:287)
at android.support.v7.app.ActionBarImplJB.setLogo(SourceFile:1)
setDisplayShowTitleEnabled
getThemedContext
at android.support.v7.app.ActionBarActivity.getMenuInflater(SourceFile:71)
at com.levelup.touiteur.TouiteurMain.onCreateOptionsMenu(SourceFile:492)
at android.app.Activity.onCreatePanelMenu(Activity.java:2504)
at android.support.v4.app.FragmentActivity.onCreatePanelMenu(SourceFile:224)
at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(SourceFile:232)
@robUx4
robUx4 / gist:7468981
Created November 14, 2013 15:42
Nexus 4 running 4.3 #cute
java.lang.StringIndexOutOfBoundsException: length=0; index=-1
at java.lang.AbstractStringBuilder.indexAndLength(AbstractStringBuilder.java:212)
at java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:206)
at java.lang.StringBuffer.charAt(StringBuffer.java:346)
at com.android.org.bouncycastle.asn1.x509.X509NameTokenizer.nextToken(X509NameTokenizer.java:78)
at com.android.org.bouncycastle.asn1.x509.X509Name.<init>(X509Name.java:719)
at com.android.org.bouncycastle.asn1.x509.X509Name.<init>(X509Name.java:655)
at com.android.org.bouncycastle.asn1.x509.X509Name.<init>(X509Name.java:593)
at android.net.http.SslCertificate$DName.<init>(SslCertificate.java:379)
at android.net.http.SslCertificate.<init>(SslCertificate.java:189)
@robUx4
robUx4 / gist:7481503
Created November 15, 2013 09:17
All this time the huge memory leak was under my eyes #DOH #LruCacheFail
@Override
protected void entryRemoved(boolean evicted, String key, Bitmap oldValue, Bitmap newValue) {
super.entryRemoved(evicted, key, oldValue, newValue);
oldValue.recycle();
}
@robUx4
robUx4 / gist:7543300
Last active December 28, 2015 18:29
OrientationDrawable: a Drawable that handles orientation changes without allocating anything updated with a fix when a Matrix is already applied in the canvas
/*
* Copyright (C) 2013 LevelUp Studio
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@robUx4
robUx4 / gist:8036041
Created December 19, 2013 08:19
You're trying too hard
try {
mWindowManager.addView(mDecor, l);
mShowing = true;
sendShowMessage();
} finally {
}
@robUx4
robUx4 / gist:8052193
Created December 20, 2013 08:59
Avoid Webview's to crash when the activity is gone
mv.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
if (getActivity()==null || !view.getWindowToken().isBinderAlive()) {
TouiteurLog.d(false, "pretend we will create a window but it's not possible anymore");
return true;
}
return super.onCreateWindow(view, isDialog, isUserGesture, resultMsg);
}
@robUx4
robUx4 / gist:9034455
Created February 16, 2014 13:47
x264 stereo mode patch for Matroska
diff --git a/output/matroska.c b/output/matroska.c
index baa0f1c..f623a2f 100644
--- a/output/matroska.c
+++ b/output/matroska.c
@@ -33,6 +33,7 @@ typedef struct
int width, height, d_width, d_height;
int display_size_units;
+ int stereomode;
@robUx4
robUx4 / gist:9091435
Created February 19, 2014 12:57
Is it OK to discard crash reports that have XposedBridge in them ?
java.lang.NullPointerException: failed to get a view at 13 in LoadedTouitsHasMore{4208b368 LoadedTouitsVoid{4208b1b8 size=0}} of o{41f0aac0 list=TouitListDBTweets{421998a0 id=-805657377}}
at com.levelup.touiteur.touits.TouitListExpandableAdapter.getGroupView(SourceFile:86)
at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)
at android.widget.AbsListView.obtainView(AbsListView.java:2240)
at android.widget.ListView.makeAndAddView(ListView.java:1790)
at android.widget.ListView.fillUp(ListView.java:725)
at android.widget.ListView.fillGap(ListView.java:664)
at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5136)
at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4247)
at android.os.Handler.handleCallback(Handler.java:733)