Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Android Exam AND-801 Topic 4 Question 81 Discussion

Actual exam question for Android's AND-801 exam
Question #: 81
Topic #: 4
[All AND-801 Questions]

You have an Android application that consists of two activities (MainActivity and SecondActivity) and you want to pass data in text field (ID: FirstNameJD) of MainAcitivity to SecondActivity. The passed data will appear in SecondActivity inside a TextView widget with Id: HelloMessageJD. You will use Intent to pass this data from MainActivity to SecondActivity. The Following two images include the Android code which will be written in MainActivity.kt and SecondActivity.kt files. Your data will not pass from MainActivity to SecondActivity due to a mistake in the code in SecodActivity.kt. Which of the following choices is a correct solution to make this app run correctly?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Nilsa
1 months ago
This is a classic Android programming mistake. The solution is definitely B, replacing `getStringExtra(name)` with `putSiringExtra(name)`. Don't worry, we've all been there before!
upvoted 0 times
Rosio
23 days ago
Yes, that's right! It's a common mistake to mix up those methods.
upvoted 0 times
...
Monroe
26 days ago
I think the correct solution is B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file.
upvoted 0 times
...
...
Ernestine
1 months ago
Haha, looks like someone's having a hard time with their Android coding! Maybe they should try turning it off and on again? Just kidding, but seriously, the answer is B. It's a simple fix, just gotta watch those typos.
upvoted 0 times
...
Josefa
1 months ago
I think the answer is B. Replacing `getStringExtra(name)` with `putSiringExtra(name)` in the SecondActivity.kt file should fix the issue. It's a simple typo that's causing the problem.
upvoted 0 times
Nancey
26 days ago
User 1: I think the answer is B. Replacing `getStringExtra(name)` with `putSiringExtra(name)` in the SecondActivity.kt file should fix the issue. It's a simple typo that's causing the problem.
upvoted 0 times
...
...
Brendan
2 months ago
I'm not sure about that. I think we need to add an if statement to solve this issue in both files.
upvoted 0 times
...
Holley
2 months ago
The issue here is that the data is being passed incorrectly in the SecondActivity.kt file. The correct solution is to use `getStringExtra(name)` instead of `putSiringExtra(name)`. This will ensure that the data is properly passed from the MainActivity to the SecondActivity.
upvoted 0 times
Lindsey
9 days ago
Yes, that's the correct solution. By replacing 'name' with 'pass', the data will be passed correctly.
upvoted 0 times
...
Ellen
13 days ago
D) Replace ''name'' with ''pass'' in intent.getSt4ingExtra( ''name'')
upvoted 0 times
...
Theola
19 days ago
The correct solution is to use `getStringExtra(name)` instead of `putSiringExtra(name)`.
upvoted 0 times
...
Karina
20 days ago
B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file
upvoted 0 times
...
Virgie
22 days ago
No, that's not the correct solution. You need to use getStringExtra instead of putSiringExtra.
upvoted 0 times
...
Rolande
23 days ago
B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file
upvoted 0 times
...
...
Rosalind
2 months ago
I agree with Ranee. That seems like the right fix to make the data pass correctly from MainActivity to SecondActivity.
upvoted 0 times
...
Ranee
2 months ago
I think the correct solution is to replace getStringExtra(\'name\') with putStringExtra(\'name\') in SecondActivity.kt file.
upvoted 0 times
...

Save Cancel