I was wondering if it’s possible in Android to declare different activities (say .ActivityA and .ActivityB) in AndroidManifest and use the same class file.
Is this achievable somehow?
One possible solution is a base class and then create other class files which inherit from that base class. But is there any other way than to have multiple class files?
I mean, the code should be almost identical for both activities I need this for. A couple of ifs here and there might be needed depending on the activity being called though.
How would you solve this problem?
[EDIT]
Judging by the responses I don’t think I made myself clear enough, sorry about that. But I explicitly need to have different activities. Not a single one passing different values through Intents.
1 Answer