How can I use getcontext() in recycler adapter class?
<p>I have adapter class that extends recyclerview.adapter and I need to use following code in this class but it has error on "this".</p>

<pre><code>public void addItems(int howMany){
    if (howMany &gt; 0) {
        int lastInsertedIndex = 11;
        for (int i = lastInsertedIndex + 1; i &lt;= lastInsertedIndex + howMany; i++) {
            mList.add(PreferenceManager.getDefaultSharedPreferences(this).getString("Item " + i));
            notifyItemInserted(mList.size() - 1);
        }
        lastInsertedIndex = lastInsertedIndex + howMany;
    }
}
</code></pre>

<p>how to fix this error ?</p>