How To Call Another Activity Method In Android Studio?
Solution 1:
MainActivity
has a layout that contains the View
s that show the user information. If you are in Base
, that Activity has a different layout that doesn't have any View
s for showing the user information. You can create a Dialog
that shows the user information, or you could add additional View
s to Base
that would show the user information, or you could rearchitect your application so that you have another Activity
which shows the user information and both MainActivity
and Base
could start that Activity
to show the user information.
In any case, you absolutely positively cannot instantiate an Activity
like MainActivity
using the new
keyword! Only Android can instantiate Activity
components, because the framework sets up the underlying Context
when it does that. It also keeps track of these components and manages the lifecycle callbacks.
Post a Comment for "How To Call Another Activity Method In Android Studio?"