Author: Adam Pioterek <adam.pioterek@protonmail.ch>
no custom constructor in fragment
app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt | 6 +
diff --git a/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt index 2825df4e54d376d7b431c928a3ac40d1116940b1..121548086633cd5414612c9d4781dd68b68542e9 100644 --- a/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt +++ b/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt @@ -304,7 +304,8 @@ return Calendar.getInstance().getMode() } } - class PlaceholderFragment(val updater: (Int) -> Unit) : Fragment() { + class PlaceholderFragment: Fragment() { + lateinit var updater: (Int) -> Unit override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val rootView = inflater.inflate(R.layout.fragment_stop, container, false) @@ -331,7 +332,8 @@ } companion object { fun newInstance(departures: List<Departure>?, relativeTime: Boolean, updater: (Int) -> Unit): PlaceholderFragment { - val fragment = PlaceholderFragment(updater) + val fragment = PlaceholderFragment() + fragment.updater = updater val args = Bundle() if (departures != null) { if (departures.isNotEmpty()) {