michaelprimez / searchablespinner

Searchable Spinner
Apache License 2.0
314 stars 102 forks source link

How to add Items to your Searchable Spinner #25

Closed spitzlitz closed 6 years ago

spitzlitz commented 6 years ago

Hello,

i am from Germany (my english is not so good) and want to add your searchable spinner in my app. I use "Android Studio" and do it like your instruction "usage":

  1. Add the dependency to your build.gradle.
  2. Usage on layout

=That works.

Now i want to add items to the searchable Spinner, but either my app crash or the searchable spinner stays empty.

Have you a tip for my?

Best regards Andreas

michaelprimez commented 6 years ago

Hi Did you check out the examples in https://github.com/michaelprimez/searchablespinner/blob/master/app/src/main/java/gr/escsoft/michaelprimez/searchablespinnerexamples/MainActivity.java ?

spitzlitz commented 6 years ago

Hi,

i try but its hard to copy all codes in my project.

Now i fail at: mSearchableSpinner.setAdapter(mSimpleArrayListAdapter);

with Error: java.lang.NullPointerException: Attempt to invoke virtual method 'void gr.escsoft.michaelprimez.searchablespinner.SearchableSpinner.setAdapter(android.widget.ListAdapter)' on a null object reference

EDIT: Sorry, i am stupid. Now it works. I love it!!!! Keep up the great work!!!