tags:

views:

46

answers:

2

Hi guys, i have an android application to display the images downloaded from the server. downloading of the image is one thread and displaying that image in main class. on compiling the emulator shows an error alert that application is stopped unexcpectedly. Is the main application(class that extends Activity) a Thread?? Please help me

Thanks in advance

A: 

You can use adb logcat to get more detailed information

Will
A: 

Hi Asif,

Every Android app is by default uni-threaded and this means all the activities (in fact, all the components) run in a single thread. So, the main application is a thread.

Regarding your exception, can you provide more details? Or you try debugging the app right from eclipse. You will get better idea that way.

Gopinath
new Thread(new Runnable() { public void run() { data = GprsConnection.getGprsConnData("url"); } }).start();
asifkt
In main class I wrote the code that shown below.this method is to get the gprs connection and read the byte array from the server.When i debug the application iam getting an alert that "Waiting for the debugger to connect". After some seconds i can debug the application. But when I Run the application am getting an alert that"Error: The Application has stopped unexpectedly Force close". new Thread(new Runnable() { public void run() { data = GprsConnection.getGprsConnData("url"); } }).start();
asifkt
Your code seems to be pretty clean.Can you go to DDMS perspective and check the logcat tool for the exact error messages?
Gopinath
are you accessing data just after starting the thread? how are you initializing the data?
bhups
data is accessed after starting the thread.
asifkt