Fatal error Spinner and ArrayAdapter
<p>I have this part of code for spinner. But  I get fatal error. What is wrong in here? Thanks! My Activity extends FragmentActivity.</p>

<pre><code>                Spinner spinner;
                String[] layers = {getString(R.string.a), getString(R.string.b), getString(R.string.c)};

                LayoutInflater li = LayoutInflater.from(this);
                View v;
                v  = li.inflate(R.layout.nearest, null);

                ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(MyActivity.this, android.R.layout.simple_spinner_item, layers);
                spinner = (Spinner) findViewById(R.id.spinner_nearest);
                spinner.setAdapter(adapter);


                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.setView(v);

                builder.setCancelable(true);
                AlertDialog alert = builder.create();
                alert.show();}
</code></pre>
