Hey, thanks for the clarification.
As for the EditViews, I am using the following code:
final EditText input_field = (EditText) findViewById(editViewINT);
if( mGameSettings.contains(preference) ){
input_field.setText(
mGameSettings.getString(preference, "does not
exist") );
//Toast.makeText(QuizSettingsActivity.this, "Exists
with value : "
+ input_field.getText() , Toast.LENGTH_SHORT ).show();
}
/*
* implementing the nickname input
*/
input_field.setOnKeyListener( new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode,
KeyEvent event) {
// TODO Auto-generated method stub
String processed_input =
input_field.getText().toString();
Editor editor =
mGameSettings.edit();
editor.putString(preference,
processed_input);
editor.commit();
//Toast.makeText(QuizSettingsActivity.this, "checking :
"+preference, Toast.LENGTH_SHORT ).show();
return false;
}
});
}
So the input is set in a sharedpreference and writing that value back
into the EditView whenever the activity is "restarted".
On Nov 12, 2:39 am, TreKing <[email protected]> wrote:
> On Thu, Nov 11, 2010 at 5:35 PM, sisko <[email protected]> wrote:
> > Then click the "menu" button on the phone. It should give you 2 options (
> > Settings and Help ).
> > Please select "setting". The view will reload.
>
> AFAICT, you're not "reloading", you're starting a new instance of the same
> activity (if you press back, the previous instance is shown, with what you
> had selected in it's drop down).
>
> I think you're confused in thinking that the spinner in the second activity
> is the same as the spinner in the first activity. It's not.
>
> What are you doing right now to save and restore the EditText values? You
> can probably do something similar for this.
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en