Re: [android-developers] constructor problem

2011-06-22 Thread TreKing
On Wed, Jun 22, 2011 at 4:36 AM, אריאל 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-22 Thread אריאל
so what can i do? 2011/6/21 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). > > >

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 yo

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 > 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?

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 אריאל > yes i know this but how i used this from some activities? > > > 2011/6/21 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 > On Mon, Jun 20, 2011 at 5:15 PM, אריאל 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

Re: [android-developers] constructor problem

2011-06-20 Thread TreKing
On Mon, Jun 20, 2011 at 5:15 PM, אריאל 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. --

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 > On Mon, Jun 20, 2011 at 1:03 PM, אריאל wrote: > >> 06-20 17:30:52.020: ERROR/AndroidRuntime(17614): >> java.lang.RuntimeException: Unable to start activity >> ComponentInfo{Hello.arie

Re: [android-developers] constructor problem

2011-06-20 Thread TreKing
On Mon, Jun 20, 2011 at 1:03 PM, אריאל 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 LogCat to figure out wh

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 > On Mon, Jun 20, 2011 at 12:54 PM, אריאל wrote: > >> when i create a obj from this class i get th

Re: [android-developers] constructor problem

2011-06-20 Thread TreKing
On Mon, Jun 20, 2011 at 12:54 PM, אריאל 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? - TreKing

[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 fo

[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); } publi