createFromResources() in ArrayAdapter cannot be applied to spinner
<p>Im having trouble when creating an ArrayAdapter on my spinner. i don't know how to explain to you guys but people say a picture speaks 1000 words. so i provide a picture of my problem. please help me i really dont know what to do know.</p>

<p><a href="https://i.stack.imgur.com/xJJUX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xJJUX.png" alt="this is my error"></a></p>

<p>this is my class</p>

<pre><code>public class SettingFragment extends Fragment{

private View rootView;
Spinner spinner;
ArrayAdapter&lt;CharSequence&gt; adapter;

public SettingFragment(){
    //required empty public constructor
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_setting, container, false);

    spinner = (Spinner)rootView.findViewById(R.id.spinner);
    adapter = ArrayAdapter.createFromResource(this, R.array.select_font_size, android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);

    return rootView;
}
</code></pre>

<p>}</p>

<p>this is my string.xml</p>

<pre><code>&lt;string-array name="select_font_size"&gt;
    &lt;item&gt;Small&lt;/item&gt;
    &lt;item&gt;Default&lt;/item&gt;
    &lt;item&gt;Large&lt;/item&gt;
    &lt;item&gt;Larger&lt;/item&gt;
&lt;/string-array&gt;
</code></pre>

<p>and this is my xml code</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"&gt;


&lt;Spinner
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/spinner"
    android:layout_gravity="center_horizontal" /&gt;
</code></pre>

<p></p>