- depend on: implementation "com.android.support:support-compat:27.1.1"
ThreadPoolExecutor
executes parallelized tasks across multiple different threads of a thread pool.
To execute work concurrently and retain control over how the work is executed, this is the tool for the job.
- constructing a new instance
- confgure the many arguments of the thread pool
- if initializing ThreadPoolExecutor in a service, ensure to create it within
onStartCommand()
notonCreate()
The HandlerThread
is a convenience class that initiates a Looper
within a Thread to process Runnable or Message objects.
The Handler
is used to handle the insertion of the Runnable
or Message
objects into the looper's queue:
The Handler
class supports several other ways to schedule a Message to be processed at a future time:
- sendMessage - Pushes a message onto the end of the message queue.
- sendMessageDelayed - Pushes a message onto the end of the message queue.
Use a Handler to run code on a given thread after a delay or repeat tasks periodically on a thread.
- constructing a
Handler
and then - "posting" Runnable code to the event message queue on the thread to be processed
handler.post(); handler.postAtFrontOfQueue();
Implementing Master/Detail with:
- adaptive
master_detail
with a handset breakpoint - a controller factory.
- Interface based contract between fragment/activity/controller whie keeping them decoupled
-
- main activity with implements the intererface for