add a null check to spinner adapter
This commit is contained in:
parent
7114d60c11
commit
ab805df2fb
1 changed files with 3 additions and 0 deletions
|
@ -18,6 +18,9 @@ class MyAppCompatSpinner : AppCompatSpinner {
|
|||
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle)
|
||||
|
||||
fun setColors(textColor: Int, accentColor: Int, backgroundColor: Int) {
|
||||
if (adapter == null)
|
||||
return
|
||||
|
||||
val cnt = adapter.count
|
||||
val items = kotlin.arrayOfNulls<Any>(cnt)
|
||||
for (i in 0..cnt - 1)
|
||||
|
|
Loading…
Reference in a new issue