Socket in AsyncTask - application crashesso the UI won't be blocked

by Jerry Fan » Wed, 21 Jul 2010 16:41:26 GMT


Sponsored Links
 ou can register a handler in your code and send message to update  your UI
component in Handler. I used this way to solve a similar problem like urs
before. For exapmpel

if (socket.isConnected()) {
OutputStreamOut = new
ObjectOutputStream(socket.
getOutputStream());
InputStreamIn = new
ObjectInputStream(socket.getInputStream());
// everything worked fine until here
//instead of doing this, send msg to a customized
handler
//statusTxt.setText("App is now connected to:\n" +
IP + " : "
mHandler.sendEmptyMessage(UPDATE TEXT); //use
something like this
+ Port); // CRASHING !!!!
connectBt.setText("Disconnect");
connected = true;
continueBt.setVisibility(0);
} else {


On Wed, Jul 21, 2010 at 12:25 AM, stephan <dkn...@googlemail.com> wrote:

>



Other Threads

1. Visuals of all standard widgets?

Is there an examples page somewhere that shows what all the standard widgets
look like?
It'd be nice to see them all on one page.
This would be especially helpful since Android seems to have come up with
their own set of names for widgets.  What they call a "Spinner", would be a
ComboBox or DropDownList on other systems.

-- 

2. OOT: Sorry, Operator lagi

 ....kemaren coba hampir 2 bulan dgn XL Broadband.....masih 
mengecewakan........
Akhirnya TFlash sy aktifin lagi, bayar tunggakan 3 bulan .....tp udah 5 
bulan gak di pake (nyumbang ke Telkomsel deh)
Langsung aktip.....Speedtest selalu diatas 800kbps.....tapiiiii.....utk 
download market gak bisa, update2 social-network gak bisa, cuma email 
doang lancar


Kemaren ketemu temen pake BB dgn Telkomsel...katanya sama, utk email 
lancar....yg lain macet



Hari ini td pas lunch............No Signal......, sampe ada yg agak 
ribut di toko langganan Comp....krn dia beli modem sama kartu 
Flash...kagak bisa2.....


Tapi aneh nya.....di Hp biasa....ada sinyal, tp No data, di Hp Android 
(ada 3 Android dgn TFlash) semua No Signal


*mo liburan malah gini......sabar....sabar....

--
Jus*
MB300
|| google membuat segalanya mudah ||
~ my porfolio foto http://www.firnaglass.com/ ~




--
===============
"

3. Is a Vertical Seekbar possible?

4. Scipad + Android + external keyboard + ssh?

5. Screen Resolution

6. Suspicious TCP RST packets while device is sleeping.

7. (Id-andoid) WTA factory reset galaxy 5