Guys,
Great answers, all. Thank you.
Please allow me to abstract this up one level. I am coming to Android
development with many years of C++ experience on many platforms so I
have a good understanding of development and OO. I am relatively new,
however, to Java and Android. I am struggling
23.03.2011 16:14, Jake Colman пишет:
If I create an instance of a singleton from within an
activity/service/receiver, am I correct that that same instance is
available to the other components of my application? If so, then is it
correct to say that all the components of my application share the
On Mar 23, 2011 9:15 AM, Jake Colman col...@ppllc.com wrote:
If I create an instance of a singleton from within an
activity/service/receiver, am I correct that that same instance is
available to the other components of my application?
For the life of the process, yes.
If so, then is it
I use the following standard paradigm for singletons:
private static MyClass instance = null;
public static MyClass getInstance() {
if( instance = null )
instance = new MyClass();
return instance;
}
If my application gets killed by Android, as can be expected, can I
reasonably assume
On Wed, Mar 23, 2011 at 12:37 PM, Jake Colman col...@ppllc.com wrote:
If my application gets killed by Android, as can be expected, can I
reasonably assume that when the application is restarted that instance
is reinitialized to null? In other words, when Adroid invisibly kills
and restarts
On Wed, Mar 23, 2011 at 11:37 AM, Jake Colman col...@ppllc.com wrote:
public static MyClass getInstance() {
if( instance = null )
instance = new MyClass();
return instance;
}
I hope that was a typo. If that's your actual code, you have bigger
problems.
On 3/23/2011 12:37 PM, Jake Colman wrote:
I use the following standard paradigm for singletons:
private static MyClass instance = null;
public static MyClass getInstance() {
if( instance = null )
instance = new MyClass();
return instance;
}
If my application gets killed by
On Wed, Mar 23, 2011 at 11:56 AM, Kenny Riddile kfridd...@gmail.com wrote:
instance == null, not instance = null...right?
Precisely.
-
TreKing http://sites.google.com/site/rezmobileapps/treking -
T == TreKing treking...@gmail.com writes:
T On Wed, Mar 23, 2011 at 11:37 AM, Jake Colman col...@ppllc.com wrote:
public static MyClass getInstance() {
if( instance = null )
instance = new MyClass();
return instance;
}
T I hope that was a typo. If that's your
T == TreKing treking...@gmail.com writes:
T On Tue, Mar 22, 2011 at 5:58 PM, Jake Colman col...@ppllc.com wrote:
But does that mean that my singleton can be taken out of scope as
well?
T Scope is not the appropriate term. But if your process gets
T killed, it takes
On Tue, Mar 22, 2011 at 6:32 PM, Jake Colman col...@ppllc.com wrote:
Do I have to assume that my application might get killed?
Yes. Not might. Will ... eventually.
If my appwidget is sitting on the homescreen and displaying it's data might
it still be killed even though it's active?
On Tue, Mar 22, 2011 at 7:32 PM, Jake Colman col...@ppllc.com wrote:
If my
appwidget is sitting on the homescreen and displaying it's data might it
still be killed even though it's active?
Your app widget is not sitting on the homescreen. It is never
sitting on the homescreen.
Your app
On Tue, Mar 22, 2011 at 4:32 PM, Jake Colman col...@ppllc.com wrote:
Do I have to assume that my application might get killed? If my
appwidget is sitting on the homescreen and displaying it's data might it
still be killed even though it's active? I recognize that my service is
killed the
13 matches
Mail list logo