Code example for SparseArray

Methods: keyAt

	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);
		TextView default_TV = (TextView) v.findViewById(;
		// Checking if the current profile is by default 
		Database db = new Database(c);
Connect your IDE to all the code out there  Get Codota for Java