Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
This is how I get Package name context.getPackageName();.
context.getPackageName();
This is how I get Class name context.getClass().getSimpleName());.
context.getClass().getSimpleName());
Then how can I get packageName including class name in one line? i.e com.package.MainActivity
i.e
com.package.MainActivity
Simply leave out Simple: context.getClass().getName()
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().
context.getPackageName()
context.getClass().getSimpleName()
context.getPackageName() + context.getClass().getSimpleName()
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.