Friday, 15 June 2012

java - SharedPreference long not translating to a String when using .valueOf() -



java - SharedPreference long not translating to a String when using .valueOf() -

i not sure why unusual reason long not converting string used programatically fire off message desired .valueof(constants.mynumber)

here code using:

shortmessagemanager.sendtextmessage(string.valueof(constants.mynumber), null, "hey there tom bob office downwards hall.", null, null);

here code used save number - set in onclicklistener:

string num1string = num1.gettext().tostring(); long longnum1 = long.parselong(num1string); sharedpreferences.editor editor = prefs.edit(); prefs.edit().putlong(constants.mynumber, longnum1).commit();

here code trying pull from:

import android.content.sharedpreferences; public class constants { public static string pref_name = "sharedstring"; public static string mynumber = "mynumber"; sharedpreferences prefs;

}

i feeling missing silly in here , maybe sec set of eyes looking @ can help. ideas?

java android sharedpreferences

No comments:

Post a Comment