Wrox Programmer Forums
|
BOOK: Professional Android 4 Application Development
This is the forum to discuss the Wrox book Professional Android 4 Application Development Reto Meier; ISBN: 978-1-1181-0227-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2013, 07:49 PM
Registered User
 
Join Date: Nov 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 10 earthquake_3 notification

The sample seems working as it supposed to. Having a question, when the notification is showing up in the taskbar and when clicking it the Earthquake activity is started. But if the Earthquake activity is already in front, still a second Earthquake instance is lunched. What is the way to only lunch the Earthquake if there is no instance of it is active?
 
Old December 3rd, 2013, 11:41 AM
Authorized User
 
Join Date: Jan 2013
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default chapter 10 earthquake_3 notification

Hi Lanny,

How did it appear to you that 2 instances of earthquake are active?
When i repeated this (clicking a notification with an earthquake app running) then i see just one earthquake active in the list of active applications.
 
Old December 4th, 2013, 07:53 AM
Authorized User
 
Join Date: Jan 2013
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default chapter 10 earthquake_3 notification

Ok, i understand a new instance of the activity (earthquake) is formed when that activity is already there in the back stack.
To prevent an existing activity to be relaunched, you could try to set :

android:launchMode="singleTop" in the earthquake activity declarations in the manifest xml.
See also : http://developer.android.com/guide/t...y-element.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 10 mahmed55 BOOK: Beginning iOS 4 Application Development 2 December 6th, 2011 08:19 PM
Chapter 2 - Notification not getting displayed shekhar.kotekar BOOK: Beginning Android Application Development 0 July 13th, 2011 03:34 AM
Chapter 8 Earthquake Notification woods620 BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 1 December 23rd, 2009 09:57 AM
Chapter 10, listing 10-10-app kiwibrit BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 2 August 18th, 2009 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.