Handler Looper | Change Fragment In Android Kotlin

 Handler Looper in Android Kotlin

Handler(Looper.getMainLooper()).postDelayed(
{
Myview.swiperefreshLayout.isRefreshing=false
},
500
)


 Fragment Manager Change Fragment in Android Kotlin

val transaction = supportFragmentManager.beginTransaction()
transaction.replace(R.id.framelayout, Topics())
transaction.addToBackStack(null)
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
transaction.commit()

R.id.framelayout is the FrameLayout that holds the fragment and Topics( ) is the new Fragment( ).

Post a Comment

0 Comments