Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7003983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:08:24+00:00 2026-05-27T21:08:24+00:00

I had a activity which contains one button and a listview.The listview contains values

  • 0

I had a activity which contains one button and a listview.The listview contains values from webservice.When i clicked on this listview item,it shows the details in another activity.

So the thing is, can we use 4 asynctask inner class in a single activity.
ie one for initial loading of contents in listview,Second will call when i click each list item,and third one for when i move to next page in listview(Listview shows only 10 items/page) and fourth will call when i clicked the button.

Is that the right method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:08:24+00:00Added an answer on May 27, 2026 at 9:08 pm

    Yes , its right . U can as many times as u want to call . But a small modification can be done , instend of call 4 AsyncTask , u can one AsyncTask by making its generic in flow .
    `

    public class GetDataFromNetwork extends AsyncTask<Void,String,Object> {private  String ipAddress;
    private  String webService;
    private  String nameSpace;
    private  String methodName;
    private Context context;
    private ProgressDialog progressDialog;
    private SoapObject request;
    private GetDataCallBack callBack;
    
    
    /**
     * Set default progress Bar properties. Internal function called from setConfig 
     *   
     * @param progressBarStyle : Progress Dialog style (spinner or horizontal)
     * @param message : Message to be displayed on progressBar
     */
    protected void setProgresDialogProperties(int progressBarStyle,
            String message) {
        progressDialog = new ProgressDialog(context);
        progressDialog.setProgress(0);
        progressDialog.setMax(100);
        progressDialog.setProgressStyle(progressBarStyle);
        progressDialog.setMessage(message);
    }
    
    
    public GetDataFromNetwork(Context context,int progressBarStyle,String message ,GetDataCallBack callBack) {
        this.callBack=callBack;
        this.context=context;
        setProgresDialogProperties(progressBarStyle, message);
    }
    
    /**
     * Used for setting up the location and config of remote location/webservice 
     * @param ipAddress : IP of webservice
     * @param webService : Name of webservice
     * @param nameSpace : NameSpace of webService
     * @param methodName :Name of function of the particular webservice
     */
    public void setConfig(String ipAddress,String webService,String nameSpace,String methodName){
        this.ipAddress=ipAddress;
        this.webService=webService;
        this.nameSpace=nameSpace;
        this.methodName=methodName;
    
    }
    
    
    /**
     * Set parameter in SoapObject
     * @param requestParamater : Map of request
     */
    @SuppressWarnings("rawtypes")
    public void sendData(HashMap<String, Object> requestParamater) {
        }
    }
    
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        progressDialog.show();
    }
    @Override
    protected Object doInBackground(Void... params) {
        return result;
    }
        @Override
    protected void onPostExecute(Object result) {
        super.onPostExecute(result);
        progressDialog.dismiss();
    }` 
    

    Now u can call this class when ever u want to interact with ur server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activity group which contains 2 activities. From first activity I goto
this is the current state/situation: I have an Activity which binds a Service which
I am facing a situation in which I have a ListView item. When I
I have a ListView which potentially contains thousands of rows, generated by a CursorAdapter.
I had a bunch of code in an activity that displays a running graph
Had a coworker ask me this, and in my brain befuddled state I didn't
I had to delete all the rows from a log table that contained about
Today we had a lot more activity than normal between our Ruby on Rails
I recently had an app rejected from the app store because of Low Memory
i have an android application which has a listview for listing 14 items inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.