Error non-default constructors in fragments

后端 未结 5 2156
长发绾君心
长发绾君心 2020-11-28 14:35

I am dealing with maps apiv2. And I am getting the following error while coding for Dialog Fragment class.

Error : Avoid non-de

5条回答
  •  眼角桃花
    2020-11-28 15:15

    The easier way is to add these to the gradle:

    android {
          lintOptions {
              checkReleaseBuilds false
          }
      }
    

    Or you can add this line in each fragment

    @SuppressLint("ValidFragment")
    public PlaceDialogFragment(Place place, DisplayMetrics dm){
        super();
        this.mPlace = place;
        this.mMetrics = dm;
    }
    

    Best solution is add lines in gradle simply.

提交回复
热议问题