Created
August 1, 2022 07:14
-
-
Save Suchiq/03b02cb9ca716fc9b095bffc39b6e0cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final TextView textView = findViewById(R.id.textViewStatus); | |
WorkManager.getInstance().getWorkInfoByIdLiveData(workRequest.getId()) | |
.observe(this, new Observer<WorkInfo>() { | |
@Override | |
public void onChanged(@Nullable WorkInfo workInfo) { | |
//receiving back the data | |
if(workInfo != null && workInfo.getState().isFinished()) | |
textView.append(workInfo.getOutputData().getString(MyWorker.TASK_DESC) + "\n"); | |
textView.append(workInfo.getState().name() + "\n"); | |
} }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment