officebluesource / ChoiceSDK

A SDK that aims to wrap similar functionalities from HMS and GMS services to one common interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an empty constructor on MapFragment

donkii opened this issue · comments

When adding a fragment though xml

<fragment xmlns:android="http://schemas.android.com/apk/res/android" android:name="at.bluesource.choicesdk.maps.common.MapFragment" />

We receive the following error

This class should provide a default constructor (a public constructor with no arguments)

Can the empty constructor be added to the MapFragment class?

If not, is there any workaround for this?

We recommend that you create a MapFragment in code and add it via fragment manager:

supportFragmentManager.beginTransaction().apply {
    mapFragment = MapFragment.newInstance()
    add(R.id.mapContainer, mapFragment)
    commit()
}

The mapContainer is just a FrameLayout in our activity.