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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:00:37+00:00 2026-05-16T02:00:37+00:00

During the most recent Google IO, there was a presentation about implementing restful client

  • 0

During the most recent Google IO, there was a presentation about implementing restful client applications. Unfortunately, it was only a high level discussion with no source code of the implementation.

In this diagram, on the return path there are various different callbacks to other methods.

google io presentation slide

How do I declare what these methods are?

I understand the idea of a callback – a piece of code that gets called after a certain event has happened, but I don’t know how to implement it. The only way I’ve implemented callbacks so far have been overriding various methods (onActivityResult for example).

I feel like I have a basic understanding of the design pattern, but I keep on getting tripped up on how to handle the return path.

  • 1 1 Answer
  • 1 View
  • 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-16T02:00:38+00:00Added an answer on May 16, 2026 at 2:00 am

    In many cases, you have an interface and pass along an object that implements it. Dialogs for example have the OnClickListener.

    Just as a random example:

    // The callback interface
    interface MyCallback {
        void callbackCall();
    }
    
    // The class that takes the callback
    class Worker {
       MyCallback callback;
    
       void onEvent() {
          callback.callbackCall();
       }
    }
    
    // Option 1:
    
    class Callback implements MyCallback {
       void callbackCall() {
          // callback code goes here
       }
    }
    
    worker.callback = new Callback();
    
    // Option 2:
    
    worker.callback = new MyCallback() {
    
       void callbackCall() {
          // callback code goes here
       }
    };
    

    I probably messed up the syntax in option 2. It’s early.

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

Sidebar

Related Questions

Can I ask the user WHERE to install the application during install time? Most
During Session Start, one has access to the Request object. How about Session End,
it gives me this error: Exception in thread Thread-163: Traceback (most recent call last):
I have problems deploying a web application to the most recent version of IBM
I'm trying to get the most recent Friday in SQL Server 2008. I have
During recent stress and volume testing, we realized that after 30minutes, all uses gets
I'm currently working on a generational garbage collector. This means that only the most
During the installation of my app, I want to create a PostgreSQL-Database and some
During compilation process many errors are thrown on the screen. To start resolving them
During our efforts to design InApp Billing for our Android App, we came up

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.