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

  • SEARCH
  • Home
  • 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 8136253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:42:16+00:00 2026-06-06T10:42:16+00:00

I have a lot of buttons on main activity. Each button run this same

  • 0

I have a lot of buttons on main activity. Each button run this same AsyncTask which do HTTP POST method but post different values (which I store in Button.Tag property). So I have one AsyncTask for all buttons. Problem is when AsyncTask done his job, it should know which button must be updated in callback (button which execute AsyncTask). I don’t want pass object (button instance) to AsyncTask because I read that activity can be recreated by system in many situations (orientation change, etc), so object passed to AsyncTask could be invalid. But what about View.ID property? It can be changed by system in activity life cycle too or can I use this integer value, pass it to AsyncTask and in onPostExecute find this button by this ID (calling findViewByID)?

Regards

  • 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-06-06T10:42:17+00:00Added an answer on June 6, 2026 at 10:42 am

    If you have your async task inside you activity as inner class you can use the integer id value in OnPostExecute by calling findViewById(int id).

    In other cases you to pass viewGroup which is holding your buttons.

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

Sidebar

Related Questions

lets say i have a main form which have a lot of functionallity. this
I'm doing this interface where I have a lot of buttons that are just
I have lot of code in my Tornado app which looks like this: @tornado.web.asynchronous
I have an app which has a main activity that calls other activities on
In my application I have a lot of UI elements (particuarly buttons) where I
I have an android application. There are a lot of buttons in it but
I have a lot of button inside my application and for every button i
I have a lot of textboxes. I have a button that will cut the
I have a UITextView that has a lot of content. I have a button
We have lot of object with this kind of design : Interface and several

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.