drag-sort-listview
drag-sort-listview copied to clipboard
Crashes when the item is bigger than the screen
I meet the same situation. Here is the solution:
in SimpleFloatViewManager.onCreateFloatView(int position), change:
mFloatBitmap = Bitmap.createBitmap(v.getDrawingCache());
to
mFloatBitmap = loadBitmapFromView(v);
Here is the loadBitmapFromView(View v):
public static Bitmap loadBitmapFromView(View v) {
final int width = v.getMeasuredWidth();
final int height = v.getMeasuredHeight();
Bitmap b = Bitmap.createBitmap( width, height, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
v.layout(0, 0, width, height);
v.draw(c);
return b;
}
I think this is mainly because view.getDrawingCache() returns null when view is bigger than screen.