Skip to content Skip to sidebar Skip to footer

How Do I Settext In Textview With Data I Took From Gson

I have tried to set it with normal setText method but the value are null and the textView are set to blank no word on it,I took the json from API and here's my code - public class

Solution 1:

Forget about converting Object into JSON and back. Instead, implement Parcelable interface by Movie.class, and send it as object between activities, for example. This is faster, cleaner and the way it should be done.

You can find AndroidStudio plugins for Parcelable. Follow this tutorial.

Solution 2:

Could you try these:

  1. Cast to Movie Movie data = (Movie) gsonBuilder.create().fromJson(Obj, Movie.class);
  2. Make sure the data received is as expected -> Print the String Obj . Logcat.d("MOVIE APP", Obj); & show me the result

Post a Comment for "How Do I Settext In Textview With Data I Took From Gson"