Fragment - InstantiationException: no empty Constructor -> Google Maps v2?

后端 未结 3 572
时光取名叫无心
时光取名叫无心 2020-12-03 03:13

I get this error message, when I open a closed App again via App-Change button:

Caused by: java.lang.InstantiationEx         


        
3条回答
  •  借酒劲吻你
    2020-12-03 03:58

    But these FragmentContact is a public class in a *.java-file and has a public empty constructor.

    The error is not complaining about FragmentContact. It is complaining about the first inner class of FragmentContact (FragmentContact$1). You cannot have a Fragment implemented as an inner class of anything, as it cannot be instantiated from outside the outer class. A static inner class is fine.

提交回复
热议问题