J
J
JohnDaniels2016-05-30 09:50:52
Android
JohnDaniels, 2016-05-30 09:50:52

What does this highlight mean in Android Studio?

this blue-green color
e9fcd8a251c34cefa4872af974a44734.png
and how to correctly pass the data to the ListAdapter?
in activation do first

AssetListAdapter<Asset> adapter = new AssetListAdapter<Asset>(this, (ArrayList<Asset>) queryResults);
listView.setAdapter(adapter);

inside adapter:
private ArrayList<Asset> list;

public AssetListAdapter(Context context, ArrayList<Asset> data){
        list = data;
        LInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

 ...

@Override
    public Asset getItem(int i) {
        return list.get(i);
    }

 @Override
    public View getView(int i, View convertView, ViewGroup parent) {

     ...

     Asset item = getItem(i);
     //и с этим item не могу ничего делать, хотя item.getClass() показывает Asset 
}

and after: I heard the opinion that ListView is outdated and you need to switch to RecycleView.
but Google says that
1) there may be problems with older versions, you need to install additional libraries. Will it run on 4.1?
2) there is some kind of shamanism with the processing of clicks on elements. is there such a thing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tiberal, 2016-05-30
@Tiberal

This is a data type (generic)
1) 4+ everything is ok with the recycler
2) there is one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question