it seems i do not use context (in shared pref command)... i get it for an
activity... i will retry...
context is optional inside an activity, correct?
--
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email
my problem solved but another problem arises:
used:
// public constructor
public CannonView(Context context, AttributeSet attrs)
{
super(context, attrs); // call super's constructor
*activity = (Activity) context; *
.
..
SharedPreferences prefs =
pass using intent while starting the activity
On Sat, Mar 9, 2013 at 6:38 PM, lselwd webmas...@poliscarhire.com wrote:
In a Canvas game if we have a class like:
*public class CannonView extends SurfaceView *
* implements SurfaceHolder.Callback*
*{*
how transfer from this a var value to
Try this piece of code
Isn't there a getContext() method for SurfaceView?
getContext().getSharedPreference();
Regards,
Jayanand
On Sat, Mar 9, 2013 at 4:26 PM, lselwd webmas...@poliscarhire.com wrote:
public class CannonView extends SurfaceView
implements SurfaceHolder.Callback
{
SharedPreferences myPrefs =
youractivityname.this.getSharedPreferences(myPrefs, MODE_WORLD_READABLE);
SharedPreferences.Editor prefsEditor = myPrefs.edit();
On Sun, Mar 10, 2013 at 12:15 AM, Jonathan S xfsuno...@gmail.com wrote:
in Shared1, Context.MODE_PRIVATE
in Shared2,
Hi,
If u r creating sharedpreferences in our activity class means
then it wont show any error other wise if u r creating shared
preferences in other java class then it ll shows errors.
in that case u need to pass the context or activity object.
this is the sample code
public class
public class CannonView extends SurfaceView
implements SurfaceHolder.Callback
{
this is its class , of function
On Saturday, March 9, 2013 11:43:08 AM UTC+2, lselwd wrote:
I have problem working with SHARED PREFERENCES, I think is project
specific... i used the same before without
In a Canvas game if we have a class like:
*public class CannonView extends SurfaceView *
* implements SurfaceHolder.Callback*
*{*
how transfer from this a var value to this
*public class CannonGame extends Activity*
*{*
without using static vars?
--
--
You received this message because you
in Shared1, Context.MODE_PRIVATE
in Shared2,
getContext().getSharedPreferenceshttp://developer.android.com/reference/android/content/Context.html#getSharedPreferences%28java.lang.String,%20int%29(top5,
Context.MODE_PRIVATE)
On Saturday, March 9, 2013 4:43:08 AM UTC-5, lselwd wrote:
I have
9 matches
Mail list logo