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.