Re: [android-developers] constructor problem

2011-06-22 Thread אריאל
so what can i do? 2011/6/21 Kostya Vasilyev kmans...@gmail.com Ariel, Pass an existing instance of Activity / Service / whatever extending Context to your class, as needed. Call getApplicationContext as necessary, to avoid keeping a reference to something which may go away (such as an

Re: [android-developers] constructor problem

2011-06-22 Thread TreKing
On Wed, Jun 22, 2011 at 4:36 AM, אריאל arielgordon...@gmail.com wrote: so what can i do? Did you read Kostya's post? 'Cause your question was answered quite well. - TreKing

Re: [android-developers] constructor problem

2011-06-21 Thread אריאל
yes i know this but how i used this from some activities? 2011/6/21 TreKing treking...@gmail.com On Mon, Jun 20, 2011 at 5:15 PM, אריאל arielgordon...@gmail.com wrote: so how i can to save setting with SharedPreferences and to get and set from other activity? Read the documentation. Using

Re: [android-developers] constructor problem

2011-06-21 Thread Kostya Vasilyev
It just depends on what class settingM is. I somehow have a feeling it's a subclass of Activity or Context, and you instantiate it yourself with new settingM - is that true? -- Kostya 2011/6/21 אריאל arielgordon...@gmail.com yes i know this but how i used this from some activities?

Re: [android-developers] constructor problem

2011-06-21 Thread אריאל
yes because SharedPreferences must to extract Activity or Context how i repair this? 2011/6/21 Kostya Vasilyev kmans...@gmail.com It just depends on what class settingM is. I somehow have a feeling it's a subclass of Activity or Context, and you instantiate it yourself with new settingM - is

Re: [android-developers] constructor problem

2011-06-21 Thread Kostya Vasilyev
Ariel, Pass an existing instance of Activity / Service / whatever extending Context to your class, as needed. Call getApplicationContext as necessary, to avoid keeping a reference to something which may go away (such as an activity). As a rule, never instantiate Activity or Service subclasses

[android-developers] constructor problem

2011-06-20 Thread אריאל
hello sorry about my english... i have a class settingM: static SharedPreferences myPreferences; public final String PREF_FILE_NAME = PrefFile; public settingM() { myPreferences = getSharedPreferences(PREF_FILE_NAME, MODE_WORLD_READABLE); } when i create a obj from this class i get the

Re: [android-developers] constructor problem

2011-06-20 Thread TreKing
On Mon, Jun 20, 2011 at 12:54 PM, אריאל arielgordon...@gmail.com wrote: when i create a obj from this class i get the force close message what the problem with the constructor? What does the LogCat say?

Re: [android-developers] constructor problem

2011-06-20 Thread אריאל
06-20 17:30:52.020: ERROR/AndroidRuntime(17614): java.lang.RuntimeException: Unable to start activity ComponentInfo{Hello.ariel/Hello.ariel.road}: java.lang.NullPointerException 2011/6/20 TreKing treking...@gmail.com On Mon, Jun 20, 2011 at 12:54 PM, אריאל arielgordon...@gmail.com wrote:

Re: [android-developers] constructor problem

2011-06-20 Thread TreKing
On Mon, Jun 20, 2011 at 1:03 PM, אריאל arielgordon...@gmail.com wrote: 06-20 17:30:52.020: ERROR/AndroidRuntime(17614): java.lang.RuntimeException: Unable to start activity ComponentInfo{Hello.ariel/Hello.ariel.road}: java.lang.NullPointerException Something is null. Use your debugger and

Re: [android-developers] constructor problem

2011-06-20 Thread אריאל
so how i can to save setting with SharedPreferences and to get and set from other activity? 2011/6/20 TreKing treking...@gmail.com On Mon, Jun 20, 2011 at 1:03 PM, אריאל arielgordon...@gmail.com wrote: 06-20 17:30:52.020: ERROR/AndroidRuntime(17614): java.lang.RuntimeException: Unable to

Re: [android-developers] constructor problem

2011-06-20 Thread TreKing
On Mon, Jun 20, 2011 at 5:15 PM, אריאל arielgordon...@gmail.com wrote: so how i can to save setting with SharedPreferences and to get and set from other activity? Read the documentation. Using SharedPreferences is very straight forward and well-documented.

[android-developers] Constructor problem

2009-08-31 Thread sweet
I've a problem with this code: public class Xml extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.liste); }