---
title: "HOW WOULD YOU PRINT A MESSAGE IN THE LOGCAT AND PREVENT THE APPLICATION TO GET STARTED?"  
description: "HOW WOULD YOU PRINT A MESSAGE IN THE LOGCAT AND PREVENT THE APPLICATION TO GET STARTED?"  
author: "Shlok Srivastava"  
published: 2018-01-23  
canonical: https://answers.mindstick.com/qa/33512/how-would-you-print-a-message-in-the-logcat-and-prevent-the-application-to-get-started  
category: "technology"  
tags: ["android"]  
reading_time: 1 minute  

---

# HOW WOULD YOU PRINT A MESSAGE IN THE LOGCAT AND PREVENT THE APPLICATION TO GET STARTED?

HOW WOULD YOU [PRINT](https://www.mindstick.com/forum/34275/only-print-data-from-datagridview-c-sharp) A [MESSAGE](https://yourviews.mindstick.com/story/5117/the-message-of-flow-what-we-learn-from-rivers) IN THE LOGCAT AND PREVENT THE [APPLICATION](https://www.mindstick.com/articles/12824/calculator-application-in-android) TO GET STARTED?

## Answers

### Answer by Arti Mishra

**Logcat window in Android:**Generally, Lolcat window is used for **displaying some message in android studio**, such as **displaying system messages, any types of error or exception,** and add some messages in your android app with the Log class. The **Log class** allows you to create **log messages** that **appear in logcat window.** And you should also use the following log methods to print message in logcat. **\****Printing Message in Logcat window :**

- Log.e(Tag, Message) ---- display error message.
- Log.w(Tag, Message) ---- display warning message.
- Log.i(Tag, Message) ---- display information message.
- Log.d(Tag, Message) ---- display debug message.
- Log.v(Tag, Message) ---- display verbose message.

**\****For restarting your app use following code in your android application.** Intent i = getBaseContext().getPackageManager(). getLaunchIntentForPackage(getBaseContext().getPackageName()); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); \


---

Original Source: https://answers.mindstick.com/qa/33512/how-would-you-print-a-message-in-the-logcat-and-prevent-the-application-to-get-started

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
