I have an application which is having login page ie my 1st intent and i hav a 2nd intent which is having some button and edittext but as soon as my app goes to second intent the 1st intent will end closing the connection between client and the server.pls help me to find how not to end the connection b/w client and server.
Asked
Active
Viewed 1,016 times
0
-
Your passing data from one Intent to another? You need to do something like this: http://stackoverflow.com/questions/2736389/how-to-pass-object-from-one-activity-to-another-in-android – Jared Burrows Apr 10 '12 at 16:59
-
Ya i checked the link u specified but when i send objects using Serialisible my application closes unexpectedly and it says the class can not implement serialiasible.how to fix that problem. – user1320574 Apr 10 '12 at 18:38
-
Maybe: http://stackoverflow.com/questions/5277876/pass-socket-objectinputstream-objectoutputstream-between-activites – Jared Burrows Apr 10 '12 at 20:23
-
can the static member or static class in one intent can be referenced from other intent. – user1320574 Apr 11 '12 at 09:02
-
I am not sure, I have only passed strings from one activity to another. I thought I could help out with a link :) – Jared Burrows Apr 11 '12 at 22:59
1 Answers
0
It sounds as if you want a Service
to manage the connection. A Service
normally has a longer lifetime than that of an individual Activity
.
You can have each Activity
bind to the Service
when created, and disconnect from the Service
on exit.

Graham Borland
- 60,055
- 21
- 138
- 179