right now I'm still working on the same code I posted from before I just 
fixed the mentioned NPE, now the data I enter and load is not loading up 
properly in another class. It saves with in the setting activity but as 
soon as I call it into something else. It calls improper data into the area 
I am trying to set it to. On top of all of this I'm building this as I 
widget so after the "Settings window" is up I have to press home to get out 
of it. How do I set this so it loads up the widget after I set the details 
(I think this might be where the issue is coming from.). Its kinda like 
burner on a stove. One ring goes out the whole burner is shot.

Either way here is the code(again)
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Settings extends Activity implements OnClickListener {

EditText sharedData;
Context c;
TextView dataResults;
public static String filename = "sharedString";
SharedPreferences someData;

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.widgetconfig);
Button b = (Button) findViewById(R.id.btnwidgetconfig);
Button b1 = (Button) findViewById(R.id.loadBtnWidgetConfig);
c = Settings.this;
b.setOnClickListener(this);
b1.setOnClickListener(this);
sharedData = (EditText)findViewById(R.id.etwidgitconfig);
dataResults = (TextView)findViewById(R.id.emsSetWidgetConfig);
someData = getSharedPreferences(filename, 0);
}

public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()){
case R.id.btnwidgetconfig:
String stringData = sharedData.getText().toString();
SharedPreferences.Editor editor = someData.edit();
editor.putString("sharedString", stringData);
editor.commit();
break;
case R.id.loadBtnWidgetConfig:
someData = getSharedPreferences(filename, 0);
String dataReturned = someData.getString("sharedString", "Can't 
Load....Sorry!");
dataResults.setText(dataReturned);
break;
}
}
}

And there is no error to speak of in this case... I'm just wondering how I 
glue this all together... 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to