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 8293429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:49:28+00:00 2026-06-08T13:49:28+00:00

This is, what I think is a basic java question here: This is for

  • 0

This is, what I think is a basic java question here:

This is for an Android project. I have this setup:

 public class MyFragmentActivity extends FragmentActivity implements
    ActionBar.TabListener {

     // lots of code edited out


    public static class RateFragment extends Fragment {

             // lots of code edited out

         class InsertTask extends AsyncTask<String, String, Void> {

               protected void onPostExecute(Void v) { {

                // I need to access ReviewTask here
                new ReviewTask().execute();

               } 

         }


    }

    public static class ReviewFragment extendsListFragment {

              class ReviewTask extends AsyncTask<String, String, Void> {

                  // code

              }


    }


}

I am really asking a basic Java question. I know its not the best method in Android.

If you must know what I am doing: (If this is confusing, this information is low priority, just for some context) I call InsertTask when a button is pressed in RateFragment and inserts data into a MySQL database. This is what I want to do in the above code: In InsertTask, at the end, call ReviewTask in the other inner class. This will update the listview (which is in the other tab).

Can ReviewTask be reached from InsertTask?

  • 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-08T13:49:29+00:00Added an answer on June 8, 2026 at 1:49 pm

    I don’t think you can do it. I just tried it out. Here’s what you can do though… have a method inside the fragment which the InsertTask’s postExecute() method calls on. In this fragment method, you can create a new ReviewTask and fire the task. This way your inner classes just talks to your parent class which acts as a delegate between calls.

    EDIT:

    public class MyFragment extends FragmentActivity {
    
            private void delegateMethod(Object result) {
                TaskB b = new TaskB();
                b.doanotherthing(result);
            }
    
            class TaskA {
                ...
                public void onPostExecute() {
                    Object result = new Object();
                    delegateMethod(result);
                }
            }
    
            class TaskB {
                public void doanotherthing(Object o) {
                    ...
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic question about generics in Java. I have a class X
(I think this is a pretty basic question on OOP, but unfortunately I wasn't
I think this is a pretty basic question, but after Googling around I can't
I am new to WCF so I think this is pretty basic. I have
I am relatively new to XSL and I think this is a basic question.
I think I have a basic understanding of this, but am hoping that someone
I think this could be a very easy question for you. But I have
I think this is a simple and a silly question. I have included a
This is a follow up question to Is there a basic Java Set implementation
I think this is a basic in java, but sorry, I ask in stackoverflow.

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.