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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:53:29+00:00 2026-06-12T19:53:29+00:00

I have default Master-Detail flow, which was created automatically when creating new project. My

  • 0

I have default Master-Detail flow, which was created automatically when creating new project. My question is. When I add a button to detail side. Is there a way to update my list side by pressing that button ? In other words, can ItemDetailFragment and ItemListFragment communicate ?

  • 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-12T19:53:30+00:00Added an answer on June 12, 2026 at 7:53 pm

    Yes just communicate through the activity with a listener.

    Your activity:

    public class MyActivity extends FragmentActivity implements OnFragmentClickListener {
        @Override
        public void OnFragmentClick(int action, Object object) {
            switch(action) {
            }
        }
    }
    

    The listener class:

        public interface OnFragmentClickListener {
            public void OnFragmentClick(int action, Object object);
        }
    

    Your fragments will then have following somewhere in code in order to implement the interface:

        @Override
        public void onAttach(Activity activity) {
            super.onAttach(activity);
            try {
                mListener = (OnFragmentClickListener) activity;
            } catch (ClassCastException e) {
                throw new ClassCastException(activity.toString() + " must implement listeners!");
            }
        }
    

    Then your fragments communicate with each other like this: fragmentA -> activity -> fragmentB. Your activity can call methodes directly on the fragments without worrying about synchronization problems.

    Example of a call from fragment a:

    mListener.OnFragmentClick(GLOBAL_ACTION_KEY someObject);
    

    Activity then handle:

    public class MyActivity extends FragmentActivity implements OnFragmentClickListener {
        @Override
        public void OnFragmentClick(int action, Object object) {
            switch(action) {
                case GLOBAL_ACTION_KEY:
                    // you call fragmentB.someMethod();
                    break;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the basic Master / Detail Views working great with the default ASP.NET
I have an ASPX Page: <%@ Page Language=C# MasterPageFile=~/site.Master AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=myProject.Presentation.Web.Default src=Default.aspx.cs %>
here's a tricky question... I have default styled input fields (no css added, just
I have a splitViewController that has a master and detail view controllers. The code
I am trying Master Detail scenario in ASP.NET MVC 3 (default view engine) .
I have an ASP.NET 3.5 intranet website which has a default page with a
So I have a master page which has the following function '# Get and/or
I have created a Web Application in asp.net 2.0. which is working fine on
My server have default php version of 4, so when I run some script
I want to be able to have default text like Enter content here... appear

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.