Is there a simple way to copy Android activities in the same project
I have an activity that works well as another part of the application I'm developing with some modifications. I want to know if I can easily copy an activity in Android studio without manually copying all its dependencies (for example, activity_my. XML)
resolvent:
Use it correctly: you have code to reuse in another activity
Now, I will not do this by copying the reused code (because if I want to modify it, I have to modify two copies, which is cumbersome work)
I'm going to create a basic activity that has the functionality you need for both activities. This functionality must be slightly abstracted so that both activities can use this functionality by extending this baseactivity and use it for their respective purposes
If you publish some code (which should be included in the code sections of both activities), I can update the answer to show you your situation