package todomore.android;

import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;


/**
 * A preferences screen that offers username/password and other settings
 */
public class PrefsActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        // Set up defaults before creating PrefsFragment
        PreferenceManager.setDefaultValues(this, R.layout.prefs, false);
        
        getFragmentManager().beginTransaction()
        	.replace(android.R.id.content, new PrefsFragment())
        	.commit();
    }
    
    public static class PrefsFragment extends PreferenceFragment {
    	
    	public void onCreate(Bundle savedInstanceState) {
    		super.onCreate(savedInstanceState);
    		addPreferencesFromResource(R.layout.prefs);
    	}
    }

}




@@ -71,16 +71,87 @@
 oid.
-os.Bundl
+content.Intent;%0D%0Aimport android.os.Bundle;%0D%0Aimport android.preference.Preferenc
 e;%0D%0A
@@ -243,16 +243,104 @@
 nager;%0D%0A
+import android.view.Menu;%0D%0Aimport android.view.MenuItem;%0D%0Aimport android.widget.Toast;%0D%0A
 %0D%0A%0D%0A/**%0D
@@ -868,16 +868,18 @@
 ommit();
+%09%09
 %0D%0A    %7D%0D
@@ -889,16 +889,589 @@
   %0D%0A    
+@Override%0D%0A    public boolean onCreateOptionsMenu(Menu menu) %7B%0D%0A    %09getMenuInflater().inflate(R.menu.prefs_menu, menu);%0D%0A%09%09return true;%0D%0A    %7D%0D%0A    %0D%0A%09@Override%0D%0A%09public boolean onOptionsItemSelected(MenuItem item) %7B%0D%0A%09%09switch (item.getItemId()) %7B%0D%0A%09%09case R.id.test_menuitem:%0D%0A%09%09%09testNetworkSetup();%0D%0A%09%09%09return true;%0D%0A%09%09case R.id.done_menuitem:%0D%0A%09%09%09finish();%0D%0A%09%09%09return true;%0D%0A%09%09default:%0D%0A%09%09%09return super.onOptionsItemSelected(item);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A    %0D%0A    private void testNetworkSetup() %7B%0D%0A%09%09Toast.makeText(this, %22Test not written yet%22, Toast.LENGTH_SHORT).show();%0D%0A%09%7D%0D%0A%0D%0A%09
 public s
@@ -1698,18 +1698,16 @@
 %0A    %7D%0D%0A
-%0D%0A
 %7D%0D%0A%0D%0A%0D%0A%0D

Use Menu Items instead of forlornly trying to add buttons to Preferences