Permalink
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 865 Bytes
package com.yagi2.navigationsample
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.navigation.Navigation
class MainFragment : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
super.onCreateView(inflater, container, savedInstanceState)
return inflater.inflate(R.layout.fragment_main, container , false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.findViewById<Button>(R.id.next_button).setOnClickListener(
Navigation.createNavigateOnClickListener(R.id.action_main_to_flow_one)
)
}
}