0

MainActivity is my parent activity with 3 tabs named Tab A,B and C.Ii use intent to create a new child activity called "ChildActivity".

I have created a TabManager in the MainActivity which controls the connection to server. When Tab B is pressed, it will start the connection to my server and will return a result message in MainActivity after 30 second. If the ChildActivity is opened, i hope it would listen to that message and execute different functions from the connection result. In iOS environment, i would get it done through the AppDelegate function. I tried to use interface but eclipse returns error. I also tried putParceable and putSerializable but it fails again.

Is there any "AppDelegate" like functions in Android?

Antoine Murion
  • 773
  • 1
  • 14
  • 26
  • Create any protocol that will work same as Appdelegate in reality AppDelegate is one of protocol class – Nilesh Kikani Apr 20 '15 at 09:35
  • Would you provide more color on this? Is there any sample codes in Android for reference? – Antoine Murion Apr 20 '15 at 09:39
  • do you know Objective C or java, in both language there is interface is one of great concept, for iPhone objective C interface is called protocol and for Java it's called Interface. So Both are same in functionality except name only? – Nilesh Kikani Apr 20 '15 at 09:42
  • Yes i know Interface and I implemented it in my program. With ref to http://stackoverflow.com/questions/3398363/how-to-define-callbacks-in-android, the class "CallBack" and "Worker" do not belong to the same activity, and eclipse gives me "edit source code" error. If both are in the same activity class, then everything is fine. – Antoine Murion Apr 20 '15 at 09:51

0 Answers0