I am trying to do a hero transition in Android 5.0 between an image in a ListView to a details page. But for about 50% of my images Android crashes with the exception below. My images are 600x400 but I tried changing them to 200x100 but got the same error. When it works, it looks great but I cannot see the difference between the various images. Really unsure why it claims the layer is too big, anybody got a clue?
private void handleNewsItemClicked(AdapterView<?> arg0, View viewClicked, int arg2) {
TopNewsItem item = ((TopNewsItem)arg0.getAdapter().getItem(arg2));
Intent intent = new Intent(getActivity(), TopNewsDetailsActivity.class);
intent.putExtra(TopNewsDetailsActivity.ARGS_ID, item.getGuid().getId());
intent.putExtra(TopNewsDetailsActivity.ARGS_IMAGE, imageUrl);
if(Build.VERSION.SDK_INT >= 21) {
ActivityOptions options = ActivityOptions
.makeSceneTransitionAnimation(this.getActivity(),
viewClicked.findViewById(R.id.image), "article_image");
this.getActivity().startActivity(intent, options.toBundle());
}else
getActivity().startActivity(intent);
}
}
W/OpenGLRenderer(18137): Layer exceeds max. dimensions supported by the GPU (1080x4628, max=4096x4096)
D/AndroidRuntime(18137): Shutting down VM
V/GAV3 (18137): Thread[main,5,main]: Tracking Exception: IllegalStateException (@MessageQueue:nativePollOnce:-2) {main}
/AndroidRuntime(18137): FATAL EXCEPTION: main
E/AndroidRuntime(18137): Process: myapp.app, PID: 18137
E/AndroidRuntime(18137): java.lang.IllegalStateException: Unable to create layer for RelativeLayout
E/AndroidRuntime(18137): at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime(18137): at android.os.MessageQueue.next(MessageQueue.java:143)
E/AndroidRuntime(18137): at android.os.Looper.loop(Looper.java:122)
E/AndroidRuntime(18137): at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime(18137): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18137): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(18137): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime(18137): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)