public abstract class BoxThreadPoolExecutorActivity
extends AppCompatActivity
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ACTION_ENDING_TASK |
protected static java.lang.String |
ACTION_STARTING_TASK |
protected static int |
DEFAULT_TIMEOUT |
static java.lang.String |
EXTRA_ITEM |
static java.lang.String |
EXTRA_USER_ID |
protected BoxItem |
mItem |
protected BoxSession |
mSession |
| Constructor and Description |
|---|
BoxThreadPoolExecutorActivity() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.concurrent.ThreadPoolExecutor |
createTaskMessagingExecutor(android.app.Application application,
java.util.Queue<BoxResponse> responseQueue)
Creates a static ThreadPoolExecutor that is meant to be used in
getApiExecutor. |
protected void |
dismissSpinner()
Dismisses the spinner if it is currently showing
|
abstract java.util.concurrent.ThreadPoolExecutor |
getApiExecutor(android.app.Application application)
Returns the api executor for the activity
|
protected BoxItem |
getMainItem()
Convenient accessor for the BoxItem that will be interacted with
|
abstract java.util.Queue<BoxResponse> |
getResponseQueue()
Returns the queue that is used for holding the responses of completed
com.box.androidsdk.content.requests.BoxRequest |
protected abstract void |
handleBoxResponse(BoxResponse response)
Handler that will be called after a BoxRequest completes.
|
protected boolean |
isTaskInProgress()
Checks if the API executor currently ahs a task in progress
|
protected void |
onCreate(android.os.Bundle savedInstanceState) |
protected void |
onDestroy() |
protected void |
onSaveInstanceState(android.os.Bundle outState) |
protected void |
resumeSpinnerIfNecessary()
Check to see if the threadpool executor is currently in the middle of a task and if so, show a spinner dialog again.
|
protected void |
setMainItem(BoxItem boxItem)
Sets the main BoxItem that will be interacted with
|
protected void |
showSpinner()
Shows the spinner with the default wait messaging
|
protected void |
showSpinner(int stringTitleRes,
int stringRes)
Shows the spinner with a custom title and description
|
public static final java.lang.String EXTRA_ITEM
public static final java.lang.String EXTRA_USER_ID
protected BoxSession mSession
protected BoxItem mItem
protected static final int DEFAULT_TIMEOUT
protected static final java.lang.String ACTION_STARTING_TASK
protected static final java.lang.String ACTION_ENDING_TASK
protected void onCreate(android.os.Bundle savedInstanceState)
protected void onSaveInstanceState(android.os.Bundle outState)
protected void onDestroy()
public abstract java.util.concurrent.ThreadPoolExecutor getApiExecutor(android.app.Application application)
application - public abstract java.util.Queue<BoxResponse> getResponseQueue()
com.box.androidsdk.content.requests.BoxRequestprotected abstract void handleBoxResponse(BoxResponse response)
response - the response object returned after a BoxRequest completesprotected boolean isTaskInProgress()
protected void resumeSpinnerIfNecessary()
protected BoxItem getMainItem()
protected void setMainItem(BoxItem boxItem)
boxItem - protected void dismissSpinner()
protected void showSpinner()
protected void showSpinner(int stringTitleRes,
int stringRes)
stringTitleRes - string resource for the spinner titlestringRes - string resource for the spinner descriptionprotected static java.util.concurrent.ThreadPoolExecutor createTaskMessagingExecutor(android.app.Application application,
java.util.Queue<BoxResponse> responseQueue)
getApiExecutor.
The ThreadPoolExecutor returned should be set to a static variable so that it is not recreated each timeapplication - application context needed for the LocalBroadcastManagerresponseQueue - the queue that will hold all responses after the requests are completed. This should be provided through getResponseQueue()