ExamGecko
Home / Google / Associate Android Developer / Practice Test 1
Ask Question

Google Associate Android Developer Practice Test 1

00:00:00
Show Answer
Report Issue   Restart test

Question 1 / 40

What is a correct part of an Implicit Intent for sharing data implementation?

val sendIntent = Intent(this, UploadService::class.java).apply { putExtra(Intent.EXTRA_TEXT, textMessage) ...
val sendIntent = Intent(this, UploadService::class.java).apply { putExtra(Intent.EXTRA_TEXT, textMessage) ...
val sendIntent = Intent().apply { type = Intent.ACTION_SEND; ...
val sendIntent = Intent().apply { type = Intent.ACTION_SEND; ...
val sendIntent = Intent(this, UploadService::class.java).apply { data = Uri.parse(fileUrl) ...
val sendIntent = Intent(this, UploadService::class.java).apply { data = Uri.parse(fileUrl) ...
val sendIntent = Intent().apply { action = Intent.ACTION_SEND ...
val sendIntent = Intent().apply { action = Intent.ACTION_SEND ...
Comment (0)
Suggested answer: D
Explanation:

Create the text message with a string

val sendIntent = Intent().apply { action = Intent.ACTION_SEND putExtra(Intent.EXTRA_TEXT, textMessage) type = "text/plain" }

Reference: https://developer.android.com/guide/components/fundamentals

asked 18/09/2024
Phillip Roos
51 questions