Mohd Abad
Mohd Abad

Reputation: 45

How to get activity name on exception using logcat?

Any solution or Hint for finding activity name in which error or exception occurred from LogCat.

your answer would be appreciated.

Upvotes: 1

Views: 331

Answers (2)

Manish
Manish

Reputation: 353

Create a variable:

private static final String TAG = YourActivity.class.getSimpleName();

and then use this code to get LogCat message:

Log.d(TAG, "Message " + ex.toString());

Upvotes: 1

Basi
Basi

Reputation: 3158

Log.d(TAG, "...Any Thing... ");

put TAG as public static String TAG = "Your Activity name";on your activity

Upvotes: 0

Related Questions