No Suitable Constructor Found For Arrayadapter
I'm getting the following error: Error:(34, 53) error: no suitable constructor found for ArrayAdapter(AllStores,ListView,Response
- >) constructor ArrayAdapter
Solution 1:
The ArrayAdapter<String>
constructor doesn't accept ListView
nor Response<List<Store>>
and in your code you added them both
ArrayAdapter<String> stringArrayAdapter=newArrayAdapter<String> AllStores.this, lv, subprises);
but it should take the Context
, layout resource id
and the List<String>
or String[]
. A simple adapter would be
ArrayAdapter<String> adapter = new ArrayAdapter<>(AllStores.this, android.R.layout.simple_list_item_1, your_string_array_or_list);
then you set that adapter to your ListView
lv.setAdapter(adatper);
If you want more complex adapter, you should create a custom ArrayAdapter
. Check out this link
http://www.ezzylearning.com/tutorial/customizing-android-listview-items-with-custom-arrayadapter
Post a Comment for "No Suitable Constructor Found For Arrayadapter"