Android Open Source - EulerSolutions Problem Select Array Adapter

From Project

Back to project page EulerSolutions.


The source code is released under:

MIT License

If you think the Android project EulerSolutions listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.eulersolutions.controllers;
/*from  w  w w  .  ja  v a2  s  .c om*/
import java.util.List;

import com.eulersolutions.model.ProblemSummary;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class ProblemSelectArrayAdapter extends ArrayAdapter<ProblemSummary> {

  private static final String TAG = "EulerSolution-ProblemSelectArrayAdapter";
  private int layoutId;
  private int textViewId;
  public ProblemSelectArrayAdapter(Context context, int resource, int textViewResourceId, List <ProblemSummary> newItems) {
    super(context, resource, textViewResourceId);
    Log.i(TAG, "Creating Object");
    layoutId = resource;
    textViewId = textViewResourceId;
    public View getView(int position, View convertView, ViewGroup parent)
    Log.i(TAG, "Building the View");
      LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View toReturn = inflater.inflate(layoutId, parent, false);
      TextView problemName = (TextView) toReturn.findViewById(textViewId);
      return toReturn;

    public long getItemId(int position) {
      return this.getItem(position).getId();

    public boolean hasStableIds() {
      return true;
    public String buildString(ProblemSummary item)
      Log.i(TAG, "Building the String");
      return "Problem" + item.getId() + ": " + item.getName();

Java Source Code List