New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Android AND-801 Exam - 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:

0/2000 characters
Lisbeth
3 months ago
Surprised there's a mistake in the code, thought it was straightforward!
upvoted 0 times
...
Mickie
3 months ago
Definitely not option B, that's a typo!
upvoted 0 times
...
Ellen
3 months ago
Wait, isn't it supposed to be putStringExtra instead of getStringExtra?
upvoted 0 times
...
Francine
4 months ago
I think option D is the right choice!
upvoted 0 times
...
Judy
4 months ago
You need to use getStringExtra to retrieve the data.
upvoted 0 times
...
Lorrie
4 months ago
I’m a bit confused about the putStringExtra and getStringExtra methods. I hope I don’t mix them up in the exam!
upvoted 0 times
...
Dona
4 months ago
I feel like adding an if statement might be overcomplicating things. I should double-check how to retrieve the data properly.
upvoted 0 times
...
Cherrie
4 months ago
I think I saw a similar question where we had to use getStringExtra correctly. Maybe replacing 'name' with 'pass' could be the right move?
upvoted 0 times
...
Shizue
5 months ago
I remember something about using Intent to pass data, but I'm not sure if I need to call startActivity in SecondActivity.
upvoted 0 times
...
Fidelia
5 months ago
This is a good test of my Android app development skills. I'll carefully consider each of the options and choose the one that best addresses the problem.
upvoted 0 times
...
Gracia
5 months ago
I'm feeling pretty confident about this one. The key is to make sure the intent is set up correctly in MainActivity.kt and that the data is being accessed properly in SecondActivity.kt.
upvoted 0 times
...
Tamesha
5 months ago
Okay, I think I've got this. The issue is likely in how the data is being retrieved in SecondActivity.kt. I'll try the different options and see which one works.
upvoted 0 times
...
Hayley
5 months ago
Hmm, I'm a bit confused by the question. I'll need to think through the process of passing data between activities and make sure I understand the correct syntax.
upvoted 0 times
...
German
5 months ago
This looks like a tricky question. I'll need to carefully review the code in the images to identify the mistake in SecondActivity.kt.
upvoted 0 times
...
Nilsa
10 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
9 months ago
Thanks for the tip! I'll make sure to remember that for next time.
upvoted 0 times
...
Rosio
10 months ago
Yes, that's right! It's a common mistake to mix up those methods.
upvoted 0 times
...
Monroe
10 months ago
I think the correct solution is B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file.
upvoted 0 times
...
...
Ernestine
10 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
10 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
8 months ago
User 4: Adding startActivity(intent) to Secondryactivity.kt might be the solution to make the app run correctly.
upvoted 0 times
...
Whitney
9 months ago
User 3: I believe the solution is D. Replace ''name'' with ''pass'' in intent.getSt4ingExtra( ''name'').
upvoted 0 times
...
Nan
9 months 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
10 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
11 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
11 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 months ago
Yes, that's the correct solution. By replacing 'name' with 'pass', the data will be passed correctly.
upvoted 0 times
...
Ellen
9 months ago
D) Replace ''name'' with ''pass'' in intent.getSt4ingExtra( ''name'')
upvoted 0 times
...
Theola
9 months ago
The correct solution is to use `getStringExtra(name)` instead of `putSiringExtra(name)`.
upvoted 0 times
...
Karina
9 months ago
B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file
upvoted 0 times
...
Virgie
10 months ago
No, that's not the correct solution. You need to use getStringExtra instead of putSiringExtra.
upvoted 0 times
...
Rolande
10 months ago
B) Replace getStringExtra(\'name\') with putSiringExtra( \'name\') in SecondActiy.kt file
upvoted 0 times
...
...
Rosalind
11 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
11 months ago
I think the correct solution is to replace getStringExtra(\'name\') with putStringExtra(\'name\') in SecondActivity.kt file.
upvoted 0 times
...

Save Cancel