Stopping the Instruction Stream Engine Object
Application Scenario
When you exit the cloud phone or reconnect to the cloud phone, you need to stop the started recvData thread and then call the stop API of the engine.
Prerequisites
The instruction stream engine has been started.
Development Process
- Stop logic threads such as recvData.
- Call the stop API of the instruction stream engine.
Encoding Instance
public class Activity implements BaseActivity {
protected void StopCloudPhone() {
threadPool.submit(new StopPhoneRunnable());
}
}
public class StopPhoneRunnable implements Runnable {
@Override
public void run() {
// Stop logic threads such as the receive thread.
upstreamReceiveDispatcher.stopBlocked();
// Stop the engine.
engine.stop();
runOnUiThread(new Runnable() {
@Override
public void run() {
finish();
android.os.Process.killProcess(android.os.Process.myPid());
}
});
}
}
Parent topic: API Development Process