Skip to content

Commit 367bb10

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 af0fa28 commit 367bb10

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 {
@@ -310,7 +311,9 @@ public void run() {
310311
binding.checkForUpdate.setOnClickListener(
311312
view -> {
312313
Toast.makeText(this, "Checking for updates...", Toast.LENGTH_SHORT).show();
313-
java.util.concurrent.Future<UpdateStatus> future = Sentry.distribution().checkForUpdate();
314+
Future<UpdateStatus> future = Sentry.distribution().checkForUpdate();
315+
// In production, convert this to use your preferred async library (RxJava, Coroutines, etc.)
316+
// This sample uses raw threads and Future.get() for simplicity
314317
// Process result on background thread, then update UI
315318
new Thread(
316319
() -> {

0 commit comments

Comments
 (0)