I am using ondragListener
for view drag . My root is viewgroup
with more viewgroup
containers into the root and am adding views like imageview/textview
inside the containers .
If I use the only container(ViewGroup
) like linearlayout
for drag and drop its working fine but if I start adding views like imageview
inside these containers and still dragging point is containers only holding this view.
onActionDrop
gets an stackoverflow error : stack size 8MB
.
onActionDrop
code is :
if (e.getAction()==DragEvent.ACTION_DROP) {
final View view = (View) e.getLocalState();
final ViewGroup from = (ViewGroup) view.getParent();
from.removeView(view);
final LinearLayout toView = (LinearLayout) v;
toView.addView(view);}
Error Logs :
java.lang.StackOverflowError: stack size 8MB
android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:6546)
android.os.TransactionTooLargeException: data parcel size 26840220 bytes
android.os.BinderProxy.transactNative(Native Method)
android.os.BinderProxy.transact(Binder.java:503)
android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:4425)
com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:90)
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)