problem with ListActivity
<p>The following is my code for SettingsActivity.java. The main activity starts this activity by calling onScreenSettings(this)</p>

<pre><code>public class SettingsActivity extends ListActivity{

static String[] main_settings = {"mode",
                            "timeout"
};
static String[] mode = { "Audio",
                  "Video",
                  "Audio/Video"
};
static String[] timeout = {
                        "1 min",
                        "5 min",
                        "10 min"
};
static String result;
static String[] display;

boolean settings_selected = false;
static String TAG = "****ALIST****";


public static void onScreenSettings(Activity c){

    display = main_settings;
    Log.d(TAG,"inside onScreenSettings");
    Intent intent = new Intent(c.getApplication(),SettingsActivity.class);
    try{
        c.startActivityForResult(intent,1);
        Log.d(TAG,"after starting activity in onScreenSettings");
    }catch(Exception e){

    }
}





@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    Log.d(TAG,"inside onCreate-before setting listview");
    setListAdapter(new ArrayAdapter&lt;String&gt;(this,
               android.R.layout.simple_list_item_1, display));
        getListView().setTextFilterEnabled(true);
        Log.d(TAG,"inside oncreate-after setting listview");

}
public void onListItemClick(ListView l, View v, int position, long id){
     result = (String) l.getItemAtPosition(position);
     if(!settings_selected){
         if(result.equals("mode")){
        display = mode;         
         }
         else if(result.equals("timeout")){
        display = timeout;              
         }
         settings_selected = true;
         Log.d(TAG,"if !setting_selected");

     }
     else{/*accepting the sub options*/
         display = main_settings;//next the main settings must be displayed
         if(result.equals("Audio")){

         }
         else if(result.equals("Video")){
             Log.d(AndroidRecorder.TAG,"inside sub option Video");
         }
         else if(result.equals("Audio/Video")){

         }
         settings_selected = false;
         Log.d(TAG,"if setting_selected");
     }
     Intent intent = new Intent(this.getApplication(),SettingsActivity.class);
     try{
        startActivityForResult(intent,1);
        Log.d(TAG,"after starting activity in ListItemClick");
    }
    catch(Exception e){

    }

}
public void onActivityResult(int requestCode, int resultCode,Intent data) {
    //nothing to do with the intent here
    Log.d(TAG,"inside onActivityResult");
    setResult(RESULT_OK, data);
    finish();
    Log.d(TAG,"inside onActivityResult-after finish()");
}
/*public void onBackPressed(){
    Log.d(TAG,"inside onBackPressed");
    finish();
    Log.d(TAG,"inside onBackPressed-after finish()");

}*/

}//end of ListActivity
</code></pre>

<p>Problem is control is not entering the <code>else /*accepting the sub options*/</code> and I can't figure out why.  As a result, the mode or timeout list is getting displayed again and again and the main_settings is not displayed.
Please help.</p>
