Hi All, I started an Activity-A which starts a Service-B. On some events Service-B starts another activity Activity-C. All these are fine until Activity-C is complete. When Activity-C is closed Activity-A comes into foreground which I do not want it. Activity-A has toggle button and Text box. The toggle button is for enabling and disabling service. To stop popping Activity-A to the foreground I called finish() after starting Service-B. This is kind of meeting what I was expecting. But this has a problem when I go back and select my Activity-A from Applications list I see my ToggleButton and Textboxes are not showing the current state.
I was thinking of creating a SharedPreferences to store values and reset them on selecting my main Activity-A. But I got stumble with the findViewById(R.id.togglebutton). This returns null if I call before setContentView(R.layout.main). I'm thinking read persistence data and set the toggleButton state before showing it to user. Not sure how to do it. Any suggestions please... Thanks in advance. -lb -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en