What is the correct way to set up an intent?
Both of the methods that you use are perfectly correct. Check out the 'Constructors' section in the docs for more info. Personally, I would use the first method when I can, as hard-coding the path to the activity is susceptible to typos etc., and also reduces the readability of your code.
The first method is contextual, because it looks for the given activity in the context of your application.
The second method is not, because you specify exactly what activity you are looking for. The drawback here is that if you change the path to the activity, or you change the app's namespace, this will no longer work.
If you're using the second method, my advice would be to store the path in a final variable like so:
public static final String DISPLAY_MESSAGE_ACTIVITY = "com.example.tutorialone.DISPLAYMESSAGEACTIVITY";
Then call it like this:
Intent intent = new Intent(DISPLAY_MESSAGE_ACTIVITY);
This way, you avoid typos etc, and your code is more readable. Hope this helps!