ActionQuery | Button SDK for Android v7.0.0
ActionQuery
This class is deprecated.
Button Actions has been deprecated. Please contact Button to update your integration.
Class Overview
This is the main class holding context information for the current screen of your application. Create an instance of this class and set relevant information representing the information presented to the user so the appropriate button can be created with as much information as possible.
An instance of this class can be passed to ActionRequest(String, ActionQuery) to prepare a request to fetch a ButtonAction.
Location Example context for a screen showing information about a restaurant where we want to provide the user with transportation methods from their location to the venue:
DropinButton button = (DropinButton) findViewById(R.id.button);
final Location restaurant = new Location("Feast", 40.7325614, -73.988068);
final ActionQuery query = ActionQuery.withSubjectLocation(restaurant);
query.setUserLocation(new Location("Work", 40.7382869, -73.9823721));
final ActionRequest request = new ActionRequest("btn-abc123", query);
Button.actions().fetch(request, new ActionListener() {
@Override
public void onComplete(@Nullable ButtonAction action, @Nullable Throwable t) {
if (action == null) return;
button.prepareWithAction(action);
}
});
Event Example context for a screen showing event information, for example a calendar event. This context information can in turn be used for e.g. on demand parking or nearby restaurants for when the show is over.
final Event event = new Event("Concert at Madison Square Garden");
event.setStart(new Date());
event.setEnd(new Date(System.currentTimeMillis() + 3 * 3600 * 1000));
final Location msg = new Location("Madison Square Garden", 40.7505045, -73.9956274);
event.setLocation(msg);
Summary
| Public Constructors |
|---|
| Public Methods |
|---|
| ActionQuery |
| static ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
Static Methods
| Public Static Methods |
|---|
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |
| ActionQuery |