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

后端 未结 3 577
时光取名叫无心
时光取名叫无心 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 04:10

      private Entity mEntity;
      public YourFragment() {}
      public static YourFragment getInstance(Entity mEntity) {
        YourFragment fragment = new YourFragment();
        fragment.mEntity = mEntity;
        return fragment;
      }
    

    when you use this fragment,just call the static method getInstance.

提交回复
热议问题