Problem with passing control to Preference activity
<p>i created application in that it will call preference from main activity based on  menu option
it is done using  Explicit intent  but it not working . when clicking the menu item
calling activity</p>

<pre><code>public boolean onCreateOptionsMenu(Menu menu)
{
    super.onCreateOptionsMenu(menu);

    menu.add(0,  Menu.FIRST+1, Menu.NONE, "Refresh");
    menu.add(0, Menu.FIRST+3, Menu.NONE, "Set Preferences");

    return true;
}

public boolean onOptionItemSelected(MenuItem item)
{
    switch(item.getItemId()) 
    {
        case Menu.FIRST+1:
            Intent intent =new Intent(this,userpreferences.class);
            startActivityForResult(intent,this.USER_PREFERENCES);
            return true;

        case Menu.FIRST+3:

            return true;    
    }

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

<p>preference xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;CheckBoxPreference
        android:key="AUTO_UPDATE" android:title="update automatically"
        android:summary="update automatically" android:defaultValue="true" /&gt;
    &lt;ListPreference android:key="MINIMUM_MARK" android:title="minimum mark"     
        android:summary="enter the minimum mark of the student" 
        android:defaultValue="30" android:entries = "@array/minimumMarks"   
        android:entryValues="@array/minimum_mark_values" 
        android:dialogTitle="Check the minimum mark required" /&gt;
&lt;/PreferenceScreen&gt;
</code></pre>

<p>Preference activity</p>

<pre><code>package com.xml.parse;

import android.os.Bundle;
import android.preference.PreferenceActivity;

public class userpreferences extends PreferenceActivity
{
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.preferences);
    }
}
</code></pre>

<p>some body plz tell me to do better or correct way</p>

<p>Regards,</p>

<p>Kariyachan</p>
