У меня есть два вида деятельности MainActivity и GameOverscreen Activity.К моей MainActivity я добавляю два вида::
java.lang.RuntimeException: Unable to start activity
java.lang.IllegalStateException: The specified child already has a parent.
You must call removeView() on the child's parent first.
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: The specified child already
has
a
parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:3562)
at android.view.ViewGroup.addView(ViewGroup.java:3415)
at android.view.ViewGroup.addView(ViewGroup.java:3360)
at android.view.ViewGroup.addView(ViewGroup.java:3336)
at com.example.admin.tetris.MainActivity.onCreate(MainActivity.java:74)
at android.app.Activity.performCreate(Activity.java:5231)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
Как я могу решить эту проблему?
Любая помощь будет признательна.