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
2 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
Cherelle
15 days ago
Thanks for the tip! I'll make sure to remember that for next time.
upvoted 0 times
...
Rosio
1 months ago
Yes, that's right! It's a common mistake to mix up those methods.
upvoted 0 times
...
Monroe
1 months ago
I think the correct solution is B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file.
upvoted 0 times
...
...
Ernestine
2 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
2 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
Annalee
2 days ago
User 4: Adding startActivity(intent) to Secondryactivity.kt might be the solution to make the app run correctly.
upvoted 0 times
...
Whitney
7 days ago
User 3: I believe the solution is D. Replace ''name'' with ''pass'' in intent.getSt4ingExtra( ''name'').
upvoted 0 times
...
Nan
13 days ago
User 2: No, that's not correct. You need to add an if statement to solve this issue in the two files.
upvoted 0 times
...
Nancey
1 months 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
24 days ago
Yes, that's the correct solution. By replacing 'name' with 'pass', the data will be passed correctly.
upvoted 0 times
...
Ellen
28 days ago
D) Replace ''name'' with ''pass'' in intent.getSt4ingExtra( ''name'')
upvoted 0 times
...
Theola
1 months ago
The correct solution is to use `getStringExtra(name)` instead of `putSiringExtra(name)`.
upvoted 0 times
...
Karina
1 months ago
B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file
upvoted 0 times
...
Virgie
1 months ago
No, that's not the correct solution. You need to use getStringExtra instead of putSiringExtra.
upvoted 0 times
...
Rolande
1 months 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
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77