can anyone tell how to implement progressbar in andriod,
iam selecting an image den while uploading i want a progress bar to check if it is loaded successfully
santhana samy
Greenhorn
Joined: Mar 15, 2012
Posts: 1
posted
0
hi,
onClick() of the image put this piece of code...
AsynTask<Void, Void,Void > lTask = new AsynTask<Void, Void,Void >(){
i have added the following lines in my code but the avd says to force close
and my logcat says:
i dont understd where is it going wrong
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted
0
Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
This seems quite clear, no?
Next time, please post only the operative code - not anything that's commented out- and only a relevant logcat excerpt that shows the output related to your app. Nobody is going to try and look through 1000 lines of something.
Suzzane Pinto
Ranch Hand
Joined: Feb 10, 2012
Posts: 204
posted
0
i have doubt in this particular lines
i am passing string in doinbackground() and my ftp storefile() returns boolean which is used to store image to server..little confused with that.
please suggest
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted
0
What does the input parameter of that method have to do with the result of the FTP operation?
You should use the string to pass in the information about what to do, though - it seems that is currently in "var".
Suzzane Pinto
Ranch Hand
Joined: Feb 10, 2012
Posts: 204
posted
0
thankyou Tim,
now i have modified the code as
still the image is not getting uploaded...im wondering if running in a different thread really solving the problem of not uploading the whole image to the server.
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted
0
You don't seem to be doing any error checking of the result. The javadocs of the FTPClient class talk about what you should be doing.
Suzzane Pinto
Ranch Hand
Joined: Feb 10, 2012
Posts: 204
posted
0
yeppieee i hav uploaded the image successfuly,just changed one line in my code
private static final int TEN_KILOBYTES = 1024 * 10*10*10*10;
n its done
thnanks to all those who took interest and replied to me patiently