Cannot solve Dear Diary - Number 9

I’m doing the exercise and have literally spend 2 hours researching coding forums and websites, to figure out how to complete this activity… I’m assuming this course contains(ed) photos, however it’s just TEXT now. Nothing to help.

Step 9: Logging
Create a string TAG in the file. It is common practice for the TAG to be named after the class we are logging from. Give it the text “MainActivity”.

In the onCreateBundle() method, call the Log.i method. Android studio should import in the Log class in the files import section. The first value you will pass to the Log.i() method will be the string TAG you created. The second value will be a string value for the message we want to log.

Log the message “I am a logging pro!”.

Please help…cannot proceed with the course…

Hello @jvb31rd, welcome to the forums! Could you post the code you’re having difficulty with? Make sure you’ve imported the correct modules to be able to use Log.

Well, there is no code. I have to write it in accordance with the instructions above. I don’t know what it is.

When you write Log statements, you need to make sure you’ve imported the correct module:

import android.util.log;

This should be written before the actual log statement. Then, you need to actually write your Log.
This article explains how to go about using Log correctly.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.