• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running Multiple Activities simultaneously

 
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have developed a simple android application, which when started opens a Timer. User is given two buttons, start/ pause. This is working fine.
What i want to do is to add a way to support multiple timers when a user swipes his finger on the screen.
When he swipes from left to right, a new timer should show up, but the previous timer should not stop. This is a way to add multiple timers.
Also, when he swipes from right to left, i want a previous timer to show.

This is what i have done so for. I have a timer activity. I have added a touch event on it. When, a person swipes his finger, i get the co-ordinates and decide whether its from left to right or right to left. This funtionality is working fine, as i can see the appropriate log messages.

The problem is when im trying to load Timer Activity. It just loads the previous Activity and doesnt really create a new one (I figured this from the timer). Is there any way to do it?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm not an expert in Anrdroid, but I had a couple of thoughts on this.
Why do the Timers need to be separaate Activities? I believe that when you go to a new Activity, the onStop() method is called which essentially halts whatever is happening in that Activity.

What about trying separate Views where each new timer is inside a custom view? Perhaps even part of a List?

Just some ideas.

Regards,
Jeremy
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic