PreferenceActivity Nullpoint Error

by Radzell » Thu, 19 Nov 2009 16:08:58 GMT


Sponsored Links
  keep getting a nullpoint error from my preferenceactivity i have no
idea whats wrong. I debug and the saveInstancestate is coming in null
for some reason, but it may be something else.

public class SettingsFrontEnd extends PreferenceActivity {
public static final String NO_SELECTION = "0&#8243";

public static final String PASSWORD_KEY = "PASSWORDKEY";
public static final String SELECTED_TARGET_KEY =
"SelectedTargetKey";
public final String QUICK_CONTACT_KEY = "QUICK_CONTACT_KEY";

private android.content.SharedPreferences.Editor editor;
private HelpiDB mDbHelper;

private EditTextPreference passwordPreference;

private SharedPreferences pref;

private CheckBoxPreference quickcontactPreference;
private ListPreference targets;

@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);

return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.settings_menu:

break;
case R.id.contact_menu:
if (targets.getValue().equals(NO_SELECTION)) {
Toast.makeText(this, "Choose a Main COntact",
Toast.LENGTH_LONG).show
();
} else {
Intent myIntent = new Intent(SettingsFrontEnd.this,
ContactFrontEnd.class);
startActivityForResult(myIntent, 0);
}
break;
case R.id.map_menu:
if (targets.getValue().equals(NO_SELECTION)) {
Toast.makeText(this, "Choose a Main COntact",
Toast.LENGTH_LONG).show
();
} else {
Intent myIntent = new Intent(SettingsFrontEnd.this,
ContactFrontEnd.class);
startActivityForResult(myIntent, 0);
}
break;
case R.id.insert_menu:
if (targets.getValue().equals(NO_SELECTION)) {
Toast.makeText(this, "Choose a Main COntact",
Toast.LENGTH_LONG).show
();
} else {
Intent myIntent = new Intent(SettingsFrontEnd.this,
InsertFrontEnd.class);
startActivityForResult(myIntent, 0);
}
break;

default:
// put your code here
}
return false;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setPreferenceScreen(createPreferenceHierarchy());

pref
.registerOnSharedPreferenceChangeListener(new
SharedPreferences.OnSharedPreferenceChangeListener() {

@Override
public void onSharedPreferenceChanged(SharedPreferences
sharedPreferences,
String key) {
if (key.equals(SELECTED_TARGET_KEY)) {
editor = pref.edit();
editor.putString(key, targets.getValue());
}
if (key.equals(PASSWORD_KEY)) {
editor = pref.edit();
editor.putString(key, passwordPreference.getText());
}
if (key.equals(QUICK_CONTACT_KEY)) {
editor



Other Threads

1. AppsLib (Archos store) is not legit?

Hello,

What do you all know about AppsLib?

I know they were a small startup store who partnered with Archos to provide
them with an app store on their devices.

Recently we found that they are distributing pirated software, including an
old copy of our product, PhoneMyPC, for free.

We have contacted AppsLib several times, and Archos directly twice, only to
be ignored by all parties.

We had AppsLib in our list of markets to release products into once our
licensing mechanism is finalized, but we have now removed them and will not
do business with them. I sincerely hope Archos device owners can download
SAM from SlideMe, or some other reputable app market.

What's your experience? Is this unusual for that store, or is this just how
they do "business"?

Warm regards,
Scott
SoftwareForMe Inc.

-- 

2. Desire ROM; MIUI 0.11.05 Englis

mantap...sedot dulu...

thx







-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

3. Image view from drawable folder path

4. View.bringToFront() not working

5. How can service return a string back to Activity?

6. Using AspectJ with Android - Pune GTUG blog

7. Link error : when linking with 3rd party static library