Android Custom Adapter not displaying any data in Activity?
<p>I have created a custom adapter for my list (JobAdapter), however, whenever I set the adapter, even if there are values (jobs arraylist parameter has a size of 2), nothing is displayed on my activity.</p>

<p>This is my adapter:</p>

<pre><code>public class JobAdapter extends ArrayAdapter&lt;Job&gt; {
    private final Context context;
    private final ArrayList&lt;Job&gt; jobs;
    private final int layoutResourceId;

    public JobAdapter(Context context, int layoutResourceId, ArrayList&lt;Job&gt; jobs) {
        super(context, layoutResourceId, jobs);
        this.context = context;
        this.jobs = jobs;
        this.layoutResourceId = layoutResourceId;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = convertView;
        ViewHolder holder = null;

        LayoutInflater inflater = (LayoutInflater) context.getSystemService((Activity.LAYOUT_INFLATER_SERVICE));

        if (view == null) {
            view = inflater.inflate(layoutResourceId, parent, false);

            holder = new ViewHolder();
            holder.title = (TextView)view.findViewById(R.id.tv_jobTitle);
            holder.payrate = (TextView)view.findViewById(R.id.tv_payRate);
            holder.startdate = (TextView)view.findViewById(R.id.tv_startDate);
            holder.workinghrs = (TextView)view.findViewById(R.id.tv_duration);
            holder.location = (TextView)view.findViewById(R.id.tv_location);
            holder.companyname = (TextView)view.findViewById(R.id.tv_companyName);
            holder.description = (TextView)view.findViewById(R.id.tv_JobDesc);
            holder.experience = (TextView)view.findViewById(R.id.tv_experienceReq);
            holder.equipment = (TextView)view.findViewById(R.id.tv_equipmentReq);

            view.setTag(holder);
        } else {
            holder = (ViewHolder)view.getTag();
        }

        Job j = jobs.get(0);

        holder.title.setText(j.getJobTitle());
        holder.payrate.setText(j.getPayrate());
        holder.startdate.setText(j.getDurationStart());
        holder.workinghrs.setText(j.getWorkingHrs());
        holder.location.setText(j.getLocation());
        holder.companyname.setText("ABC Company");
        holder.description.setText(j.getDescription());
        holder.experience.setText("3-5 years");
        holder.equipment.setText("Hardhat");

        //TODO: add hardhat, boots and other field to objects mapped

        return view;
    }
    static class ViewHolder
    {
        TextView title;
        TextView payrate;
        TextView startdate;
        TextView workinghrs;
        TextView location;
        TextView companyname;
        TextView description;
        TextView experience;
        TextView equipment;
    }
}
</code></pre>

<p>This is how I am setting the adapter in the AsyncTask OnPostExecute:</p>

<pre><code>protected void onPostExecute(ArrayList&lt;Job&gt; result) {

            arrayAdapter = new JobAdapter(getApplicationContext(), R.layout.jobcard, result);
            arrayAdapter.notifyDataSetChanged();

            flingContainer.setAdapter(arrayAdapter);
        }
</code></pre>

<p>What could be the problem with this? There is no error message in Logcat and the application still runs fine, just no data shown. Data should be shown in the jobcard.xml layout which is defined for the JobAdapter.</p>

<p>Thanks in advance for any help with this!</p>

<h2>EDIT:</h2>

<p>It looks like getView() in the JobAdapter is not being called, I have tried to override the getCount() method in the JobAdapter to return 1 just so I can see one element but that did not work either. </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_gravity="top"
    android:layout_width="match_parent"
    android:layout_height="415dp"
    android:padding="5dp"
    android:layout_marginTop="20dp"&gt;

    &lt;LinearLayout
        android:id="@+id/outerMainCardLayout"
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:layout_gravity="center_horizontal|top"
        android:orientation="vertical"
        android:background="@drawable/swipecard_shadow"
        android:gravity="top"
        android:layout_marginLeft="5dp"&gt;

        &lt;LinearLayout
            android:id="@+id/mainCardLayout"
            android:layout_width="match_parent"
            android:layout_height="400dp"
            android:layout_gravity="center_horizontal|top"
            android:orientation="vertical"
            android:weightSum="1"
            android:background="#FFFFFF"
            android:gravity="top"&gt;

            &lt;TextView
                android:id="@+id/tv_jobTitle"
                android:background="#ffffff"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:textStyle="bold"
                android:textSize="16sp"
                android:textColor="#505353"
                android:textAlignment="center"
                tools:text="Cement Pouring Guy"
                android:layout_gravity="center_horizontal"/&gt;

            &lt;TextView
                android:id="@+id/tv_companyName"
                android:background="#ffffff"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="14sp"
                android:textColor="#505353"
                android:textAlignment="center"
                tools:text="ABC Company"
                android:layout_gravity="center_horizontal" /&gt;

            &lt;LinearLayout
                android:id="@+id/cardHeader"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center" &gt;

                &lt;TextView
                    android:id="@+id/tv_experienceReq"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="15dp"
                    android:layout_marginLeft="10dp"
                    android:textSize="14sp"
                    android:textColor="#505353"
                    android:drawableTop="@drawable/ic_experience"
                    tools:text="3-5 years" /&gt;

                &lt;View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="1" /&gt;

                &lt;TextView
                    android:id="@+id/tv_location"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="15dp"
                    android:textSize="14sp"
                    android:textColor="#505353"
                    android:drawableTop="@drawable/ic_location"
                    tools:text="Langley, BC" /&gt;

                &lt;View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="1" /&gt;

                &lt;TextView
                    android:id="@+id/tv_payRate"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="15dp"
                    android:layout_marginRight="10dp"
                    android:textSize="14sp"
                    android:textColor="#505353"
                    android:drawableTop="@drawable/ic_payrate"
                    tools:text="125/day" /&gt;

            &lt;/LinearLayout&gt;

            &lt;TextView
                android:id="@+id/tv_JobDesc"
                android:textSize="14sp"
                android:textColor="#505353"
                android:background="#e6e7e8"
                tools:text="Pour Cement, Mix Cement, Level Cement and go pick up cement bags."
                android:layout_width="match_parent"
                android:layout_height="150dp"
                android:padding="15dp" /&gt;

            &lt;LinearLayout
                android:id="@+id/additionalInfo"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center" &gt;

                &lt;TextView
                    android:id="@+id/tv_startDate"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="15dp"
                    android:textSize="14sp"
                    android:textColor="#505353"
                    android:layout_marginLeft="10dp"
                    android:drawableTop="@drawable/ic_date"
                    tools:text="June 1, 2016" /&gt;

                &lt;View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    /&gt;

                &lt;TextView
                    android:id="@+id/tv_duration"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="15dp"
                android:textSize="14sp"
                android:textColor="#505353"
                android:drawableTop="@drawable/ic_clock"
                tools:text="  8h" /&gt;

            &lt;View
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="1"
                /&gt;

            &lt;TextView
                android:id="@+id/tv_equipmentReq"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="15dp"
                android:textSize="14sp"
                android:textColor="#505353"
                android:layout_marginRight="10dp"
                android:drawableTop="@drawable/ic_hardhat"
                tools:text="Hardhat" /&gt;

        &lt;/LinearLayout&gt;

    &lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;

&lt;View
    android:id="@+id/item_swipe_left_indicator"
    android:alpha="0"
    android:layout_width="20dp"
    android:layout_height="20dp"
    android:layout_margin="20dp"
    android:background="#FFFFFF" /&gt;

&lt;View
    android:id="@+id/item_swipe_right_indicator"
    android:alpha="0"
    android:layout_width="20dp"
    android:layout_height="20dp"
    android:layout_margin="20dp"
    android:layout_gravity="right"
    android:background="#FFFFFF" /&gt;
</code></pre>

<p></p>