Forums Register Login
how to get progress bar after selecting a view
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

onClick() of the image put this piece of code...

AsynTask<Void, Void,Void > lTask = new AsynTask<Void, Void,Void >(){

ProgressDialog lDialog;
protected void onPreExecute(){
lDialog = ProgressDialog .show(context, "","Your msg",true);

protected void doInBackground(Void... params){
// do your uploading task here
return null;

protected void onPostExecute(){

hey thanks for the above post,

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

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.
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
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".
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.
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.
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
Poop goes in a willow feeder. Wipe with this tiny ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter

This thread has been viewed 2217 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 19, 2018 03:18:10.