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
InputStreamIn = new
// everything worked fine until here
//instead of doing this, send msg to a customized
//statusTxt.setText("App is now connected to:\n" +
IP + " : "
mHandler.sendEmptyMessage(UPDATE TEXT); //use
something like this
+ Port); // CRASHING !!!!
connected = true;
} else {

On Wed, Jul 21, 2010 at 12:25 AM, stephan <> 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 
Akhirnya TFlash sy aktifin lagi, bayar tunggakan 3 bulan 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....

|| google membuat segalanya mudah ||
~ my porfolio foto ~


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