Created
March 20, 2021 09:58
-
-
Save NezSpencer/9b622017e99022e2251f0ab902f40d95 to your computer and use it in GitHub Desktop.
Recreating the multiple click action that happens when a screen lags causing the "navigation action not found" error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nezspencer.navigationtest | |
import android.os.Bundle | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.navigation.fragment.findNavController | |
import kotlinx.android.synthetic.main.fragment_one.* | |
class FragmentOne : Fragment(R.layout.fragment_one) { | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
btn_open_screen_two.setOnClickListener { | |
performDoubleClick() | |
} | |
} | |
private fun performDoubleClick() { | |
for (i in 1 downTo 0) { | |
findNavController().navigate(FragmentOneDirections.actionFragmentOneToFragmentTwo()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment