Skip to content

Commit 9c228e4

Browse files
runningcodeclaude
andcommitted
refactor(samples): Add Future import and async library comment (EME-413)
Improves code readability by importing Future instead of using fully qualified name. Adds guidance comment suggesting developers convert the sample to their preferred async library (RxJava, Coroutines, etc.) in production code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 64832c8 commit 9c228e4

File tree

1 file changed

+4
-1
lines changed
  • sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android

1 file changed

+4
-1
lines changed

sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MainActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.Collections;
3030
import java.util.List;
3131
import java.util.concurrent.CountDownLatch;
32+
import java.util.concurrent.Future;
3233
import timber.log.Timber;
3334

3435
public class MainActivity extends AppCompatActivity {
@@ -315,7 +316,9 @@ public void run() {
315316
binding.checkForUpdate.setOnClickListener(
316317
view -> {
317318
Toast.makeText(this, "Checking for updates...", Toast.LENGTH_SHORT).show();
318-
java.util.concurrent.Future<UpdateStatus> future = Sentry.distribution().checkForUpdate();
319+
Future<UpdateStatus> future = Sentry.distribution().checkForUpdate();
320+
// In production, convert this to use your preferred async library (RxJava, Coroutines, etc.)
321+
// This sample uses raw threads and Future.get() for simplicity
319322
// Process result on background thread, then update UI
320323
new Thread(
321324
() -> {

0 commit comments

Comments
 (0)