More Than One Instance of Application

by Noam » Fri, 10 Apr 2009 05:39:38 GMT


Sponsored Links
 Hello,
Is there a way to prevent the user of opening more than one instance
of my application?

For example:
User clicks on App and opens it.
The user clicks on the home button. (the app is still running in the
background)
The user clicks on (not the menu button, but the button above it in
the homescreen), and then opens the application again.
Does it open the same instance, or does it create another one?
If it does create another one, how can I prevent it from creating
another one, and just opening the existing instance?

Thanks,
Noam.
--~--~---------~--~----~------------~-------~--~----~



More Than One Instance of Application

by Dianne Hackborn » Fri, 10 Apr 2009 06:29:56 GMT


 It brings the currently running instance to the foreground.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


More Than One Instance of Application

by Jason Van Anden » Fri, 10 Apr 2009 21:02:36 GMT


 I ran into this as well. Try adding this to the Activity tag ...

android:launchMode="singleTask"

Jason Van Anden
 http://www.smileproject.com 






--~--~---------~--~----~------------~-------~--~----~



More Than One Instance of Application

by Roman Baumgaertner » Mon, 13 Apr 2009 12:04:16 GMT


 Noam,

Try to use the singleton pattern in your application. If you have already an
instance created and try to create another one, then you would not be able
to do this.


Sr. SW Engineer
Roman Baumgaertner

T  Mobile stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.









--~--~---------~--~----~------------~-------~--~----~



More Than One Instance of Application

by Roman » Mon, 13 Apr 2009 12:04:17 GMT


 Noam,

Try to use the singleton pattern in your application. If you have
already an instance created and try to create another one, then you
would not be able to do this because of the singleton pattern.


Sr. SW Engineer
Roman Baumgaertner

T  Mobile stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.




--~--~---------~--~----~------------~-------~--~----~



More Than One Instance of Application

by Streets Of Boston » Mon, 13 Apr 2009 22:32:56 GMT


 This won't work.

Android controls the creation of activities. Android provides
callbacks such as 'onCreate' (and 'onDestroy', etc.) that inform the
application developer of the lifetime management of his/her activity.

In anser to the original question from Noam:
go to  http://developer.android.com/guide/topics/fundamentals.html and 
read up on the "Launch Modes" section. You'll get the info you need
from there.




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Netconf4Android - Configuration Protocol on Android

Hello everyone,

I wanted to let you know of a project concerning the possibility of exploiting 
the NETCONF protocol (Configuration Protocol) on Android.

The NETCONF protocol is a special Internet protocol developed by IETF for 
configuration, guidance and monitoring of devices on a network (RFC4741).

It use a client/server communication, typically via SSH-2 as the transport 
protocol.

The project is called:

       Netconf4Android

This is the url of the project on Google Code:

       http://code.google.com/p/netconf4android/

The project is compatible with Android API level 8 and above and with Java 1.5 
and above.

I invite you to view the project in case it is of interest to you.

Any kind of suggestion or contribution is welcome.

Thank you for your attention.

Best Regards,

Giuseppe Palmeri


      

-- 
.

2. Uploading Document to Google Docs

Hi,

I am trying to develop an application which requires users to login to their
gmail accounts and then helps them to upload a document to their Google Docs
account,

i tried the gdata library which works fine for a normal desktop java
application, however, the same is not working for android. I am stuck with
using Google API Client Library for Java. I am unable to figure things out.
It would be great if someone could please guide me a bit.

Thanks !
Cuil

-- 

3. D

4. Volume Control ANR

5. PV Opencore on Gingerbread

6. Listview...

7. Google map application now working in Micromax A60