<Kotlin: The app keeps stopping when start another...
# stackoverflow
r
Kotlin: The app keeps stopping when start another activity Help me. I have this problem when I try to access another activity. When I try to log in, the app crashes. val Context.dataStore by preferencesDataStore(name="SESSION_DATA") class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) lifecycleScope.launch(Dispatchers.IO){ getDataStore().collect(){ withContext(Dispatchers.Main){...