@everyone
BackFeb 28, 2023, 14:36 Feb 28, 2023, 16:49 Feb 28, 2023, 16:53 Feb 28, 2023, 17:02 Feb 28, 2023, 17:24 Feb 28, 2023, 17:35 Feb 28, 2023, 17:36 Feb 28, 2023, 17:39 Feb 28, 2023, 17:50 Feb 28, 2023, 17:51 Feb 28, 2023, 17:53 Feb 28, 2023, 17:54 Feb 28, 2023, 18:35 Feb 28, 2023, 18:37 Feb 28, 2023, 18:49 Feb 28, 2023, 18:51
ResolvedAndroid
[SOLVED] Facing error while passing context
Dec 27, 2023, 22:11
Votes
0
Replies
15
Participants
Unknown
Messages
16
gyancodesOriginal post
Summary
The user initially faced an error while passing context. Another user suggested looking at a specific code line in a GitHub repository. The first user thanked the helper but mentioned that they were still looking for a solution. The conversation continued with apologies and a clarification that the issue was not theirs. Another user asked if the problem was resolved, and the first user mentioned that they were open to using their repository as an example for Jetpack Compose. There was also a mention of using viewmodels. The final message requested the first user to show how the context is passed into the class.
Der Sarco
can you show how the context is passed into that class?
Der Sarco
if you are in MainActivity use getContext() instead of context
gyancodes
@everyone
getContext() or getApplicationContext() ?
Der Sarco
getContext if you are inside of an Activity
Drake
Der Sarco
the correct way using viewmodels 😄
Der Sarco
@Steven if you want to use my repo as Jetpack Compose example i don't have any problem with that 🙂
Drake
so is your problem resolved?
Der Sarco
is not mine, i'ts @gyancodes issue
Drake
oh god im sorry 🫢
Der Sarco
np 🙂
gyancodes
@everyone
@Der Sarco Thanks for help, but I am still finding the solution,
Drake
gyancodes
@everyone
@Steven Oh I looked into it and It helped to resolve my problem, thanks 🫡
Drake
[SOLVED] Facing error while passing context