Back

[SOLVED] Facing error while passing context

  • 0
  • Android
gyancodes
28 Feb, 2023, 14:36
TL;DR
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
28 Feb, 2023, 16:49

can you show how the context is passed into that class?

Der Sarco
28 Feb, 2023, 16:53

if you are in MainActivity use getContext() instead of context

gyancodes
28 Feb, 2023, 17:02

getContext() or getApplicationContext() ?

Der Sarco
28 Feb, 2023, 17:24

getContext if you are inside of an Activity

Der Sarco
28 Feb, 2023, 17:36

the correct way using viewmodels πŸ˜„

Der Sarco
28 Feb, 2023, 17:39

@Steven if you want to use my repo as Jetpack Compose example i don't have any problem with that πŸ™‚

Drake
28 Feb, 2023, 17:50

so is your problem resolved?

Der Sarco
28 Feb, 2023, 17:51

is not mine, i'ts @gyancodes issue

Drake
28 Feb, 2023, 17:53

oh god im sorry 🫒

Der Sarco
28 Feb, 2023, 17:54

np πŸ™‚

gyancodes
28 Feb, 2023, 18:35

@Der Sarco Thanks for help, but I am still finding the solution,

gyancodes
28 Feb, 2023, 18:49

@Steven Oh I looked into it and It helped to resolve my problem, thanks 🫑

Drake
28 Feb, 2023, 18:51

[SOLVED] Facing error while passing context

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more