Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Callback in Android?

Tags:

In Android application development, I frequently go through the word CallBack in many places. I want to know what it means to tell us technically - and how I can manage to use the callback in applications. I need a guide to understand it and use it.

like image 564
Praveen Avatar asked Apr 02 '10 13:04

Praveen


People also ask

What is callback used for?

Callbacks are generally used when the function needs to perform events before the callback is executed, or when the function does not (or cannot) have meaningful return values to act on, as is the case for Asynchronous JavaScript (based on timers) or XMLHttpRequest requests.

How many callback methods are in Android?

An Android activity goes through six major lifecycle stages or callbacks. These are: onCreate() , onStart() , onResume() , onPause() , onStop() , and onDestroy() . The system invokes each of these callbacks as an activity enters a new state.

What is callback in calling?

In telecommunications, a callback or call-back occurs when the originator of a call is immediately called back in a second call as a response.

Why callback is required?

Callbacks make sure that a function is not going to run before a task is completed but will run right after the task has completed. It helps us develop asynchronous JavaScript code and keeps us safe from problems and errors.


1 Answers

i want to know what it means, tell us technically

http://en.wikipedia.org/wiki/Callback_%28computer_science%29

"In object-oriented programming languages without function-valued arguments, such as Java, [callbacks] can be simulated by passing an abstract class or interface, of which the receiver will call one or more methods, while the calling end provides a concrete implementation. Such objects are effectively a bundle of callbacks, plus the data they need to manipulate. They are useful in implementing various design patterns such as Visitor, Observer, and Strategy."

how i can manage the callback of the applications

I have no idea what this means.

like image 187
CommonsWare Avatar answered Nov 09 '22 20:11

CommonsWare