Multiple Instances

32 views
Skip to first unread message

olajideo...@gmail.com

unread,
Nov 21, 2014, 2:33:56 PM11/21/14
to phon...@googlegroups.com

App creating multiple instances.

Samsung and HTC device.

Test Case:
Open app, play music.
Place or receive a call.
Open app from the app drawer
New instance is opened.

Greg Allensworth

unread,
Nov 21, 2014, 2:59:35 PM11/21/14
to phon...@googlegroups.com
In your android manifest, make sure to set launchMode:"singleTask" on
the <activity> element.

http://developer.android.com/guide/topics/manifest/activity-element.html

If you're using Phonegap Build, this is a known problem of PGB: they do
not set this launchMode, so you'll always start a new instance, lose
your in-app state, etc. (if PGB has changed this, please correct me!)

-g
> --
> -- You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
> ---
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to phonegap+u...@googlegroups.com
> <mailto:phonegap+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--
Greg Allensworth, Senior Web GIS Developer
BS A+ Network+ Security+ Linux+ Server+

GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510 San Francisco CA 94104
PH: 541-223-7636 email: gre...@greeninfo.org
Web: www.GreenInfo.org www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org

olajideo...@gmail.com

unread,
Nov 22, 2014, 10:27:04 PM11/22/14
to phon...@googlegroups.com
Used a fix for Phonegap Build.



<widget xmlns     = "http://www.w3.org/ns/widgets"
       
xmlns:gap = "http://phonegap.com/ns/1.0"
       
xmlns:android = "http://schemas.android.com/apk/res/android"
       
id        = "com.kingola.kingola"
       
version   = "4.0.5">


   
<preference name="AndroidLaunchMode" value="singleInstance" />
   
<preference name="AndroidAlwaysRetainTaskState" value="true" />

   
<gap:config-file platform="android" parent="/manifest/application">
       
<activity android:launchMode="singleInstance" />
   
</gap:config-file>


Thank You.
Reply all
Reply to author
Forward
0 new messages