Created
September 17, 2019 13:39
-
-
Save muzafakar/45bbb84780f3ba988300d143abb18709 to your computer and use it in GitHub Desktop.
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
class RegisterAddressFragment : FragmentViewModel() { | |
private val provinceList = mutableListOf<String>() | |
private lateinit var adpProvince: ArrayAdapter<String> | |
override fun onCreate(savedInstanceState: Bundle?) { | |
/* | |
provinceList sudah terisi dari LiveData | |
*/ | |
adpProvince = ArrayAdapter(context!!, android.R.layout.simple_spinner_item, provinceList) | |
} | |
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? = | |
inflater.inflate(R.layout.fragment_register_address, container, false) | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
// set adapter to spinner | |
spProvince.adapter = adpProvince | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment