tags:

views:

11

answers:

0

Hi, i have been developing an Android App, and within this App I have a main class which can be seen as a control/management class... It's a plain Java class and it connects all the Activity's, Services, ListView's etc... It also should be able to keep track of all existing aforementioned entities... I noticed thoug, because every Activity has it's own lifecycle, it's pretty difficult to create such a tracking funcitonality... In my specific case I have two activities, both are some kind of list... The user starts out with a startscreen, some kind of Form which will get filled with the selected info... So the user gets a List with the first option, this specific activity gets started with startActivityForResult, then the user gets a new List so that he can refine his choice... The second list again gets started by the first one through startActivityForResult. When the user has selected an option this option gets returned to the first list (through setResult(RESULT_OK,returnIntent)) and the first list takes exactly the same answer and returns it to the beginning form, again thorugh setResult... I was hoping that the second List could send the answer to my control class, which then would send it to my Form... Is there some way to achieve this ? How could a control class keep track of the existing Form and it's references ?

Also, this same control class should be able to show alerts, like above any Activity... For example if something happens in another thread (lets say a networking thread), this thread will pass the error to the control class and the control class should be able to show an Alert (or something similar) to the Activity which is on screen in that moment in time...