2

This is how I get Package name context.getPackageName();.

This is how I get Class name context.getClass().getSimpleName());.

Then how can I get packageName including class name in one line? i.e com.package.MainActivity

1 Answer 1

3

Simply leave out Simple: context.getClass().getName()

This should work.

Alternatively if you insist on using context.getPackageName() and/or context.getClass().getSimpleName() consider context.getPackageName() + context.getClass().getSimpleName().

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.