Kotlin Viewpager+fragment error: java.lang.IllegalStateException: Fragment already added

private var fileUrl: String = "" 
private var taskIds: String = ""
override fun onActivityCreated(savedInstanceState: Bundle?) { 
    super.onActivityCreated(savedInstanceState) 
    fileUrl = activity!!.intent.getStringExtra("fileUrl") 
    taskIds = activity!!.intent.getStringExtra("taskIds") 
} 
If this is used then if If getStringExtra() returns null, it will report java.lang.IllegalStateException: Fragment already added

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *