I am having a headache understading how to pass values to an activity inside a library.
I have created a library that contains an activity ( Lets call that activity ShowEmailActivity).
Inside ShowEmailActivity I have got a variable called email of type string and a function called setEmail that takes as a parameter a string.
(example: fun setEmail(email:String){this.email=email})
What i want to do is to show this email as a textview inside my xml ( this is not hard, I know how to do this )
When I add my library as a module depedency from File ->Project structure -> Dependencies ( I then select my main application ) -> + Module depedency Everything works well.
I can even call the ShowEmailActivity from my MainActivity inside my application.
However, what i want to do is to call setEmail function from ShowEmailActivity so that i can set my email from the MainActivity.
What i thought of doing was to create an object of that class inside my MainActivity Class:
val showEmailActivity = ShowEmailActivity()
showEmailActivity.setEmail(myEmail)
However , when i open an intent to open my ShowEmailActivity , nothing happens.
I am clearly doing something wrong, can anybody suggest anything ?
Thank you.