Code example for SparseArray

Methods: valueAt

	public int getCount() { 
		return profilesList.size();
	public Profile getItem(int position) {
		return profilesList.valueAt(position);
	public long getItemId(int position) {
		return profilesList.keyAt(position);
	public View getView(int position, View convertView, ViewGroup parent) {
		View v = convertView;
		Profile profile = profilesList.valueAt(position); // Collect the profile concerned
		if (v == null){
			LayoutInflater vi = (LayoutInflater) this.c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			v = vi.inflate(R.layout.item_list, null);
Experience pair programming with AI  Get Codota for Java