UsersAdapter in Usersadapter cannot be applied to (...)
<p>I am trying to learn to show an array of article links in a ListView. I get this error message when trying to create an adapter to convert the array items into views.</p>

<pre><code>Error:(62, 36) error: constructor UsersAdapter in class 
    HovedSide.UsersAdapter cannot be applied to given types;
    required: Context,ArrayList&lt;HovedSide.User&gt;
    found: HovedSide.UsersAdapter,ArrayList&lt;HovedSide.User&gt;
    reason: actual argument HovedSide.UsersAdapter cannot be
    converted to Context by method invocation conversion
</code></pre>

<p>Source code:</p>

<pre><code>public class HovedSide extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hoved_side);
    }

    public class User {
        public String article;

        public User(String article) {
            this.article = article;
        }
    }
    public class UsersAdapter extends ArrayAdapter&lt;User&gt; {
        public UsersAdapter(Context context, ArrayList&lt;User&gt; users) {
            super(context, 0, users);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            User user = getItem(position);
            view
            if (convertView == null) {
                convertView = LayoutInflater.from(getContext()).inflate(R.layout.items_list, parent, false);
            }
            TextView articlename = (TextView) convertView.findViewById(R.id.tvarticle);
            articlename.setText(user.article);          
            return convertView;

            ArrayList&lt;User&gt; arrayOfUsers = new ArrayList&lt;User&gt;();
            UsersAdapter adapter = new UsersAdapter(this,arrayOfUsers);
            ListView listView = (ListView) findViewById(R.id.listView);
            listView.setAdapter(adapter);
            User newUser = new User("Article1");
            adapter.add(newUser);
        }
    }
}
</code></pre>

<p>Error in:</p>

<pre><code>UsersAdapter adapter = new UsersAdapter(this,arrayOfUsers);
</code></pre>

<p>Tried replacing it with following, as other posts suggested;</p>

<pre><code>UsersAdapter adapter = new UsersAdapter(getActivity(),arrayOfUsers);
</code></pre>