I am trying to run the open source app in which i am getting the error as
lateinit property textInput has not been initialized
The main code where the textInput
is used
class MainActivity : BaseActivity() {
private val drawerToggle by lazy { ActionBarDrawerToggle(this, drawer_layout, drawer_open, drawer_close) }
private val survivalContent by lazy { SurvivalContent(assets) }
private lateinit var currentUrl: String
private lateinit var currentTopicName: String
private lateinit var textInput: MutableList<String>
private var lastFontSize = State.getFontSize()
private var lastNightMode = State.nightModeString()
private var lastAllowSelect = State.allowSelect()
private val linearLayoutManager by lazy { LinearLayoutManager(this) }
private var isInEditMode by observable(false, onChange = { _, _, newMode ->
if (newMode) {
fab.setImageResource(drawable.ic_image_remove_red_eye)
contentRecycler.adapter = EditingRecyclerAdapter(textInput)
} else {
fab.setImageResource(drawable.ic_editor_mode_edit)
contentRecycler.adapter = MarkdownRecyclerAdapter(textInput, imageWidth(), onURLClick)
}
contentRecycler.scrollToPosition(State.lastScrollPos)
})
Since i am new to android development i don't to how to initialize the lateinit variable before using it.Before this i tried to do the git submodule update
as mentioned in this github but it didn't worked.so now i hope the problem is in initializing the textInput variable.