How to parcelize Google's Place class? The Next CEO of Stack OverflowAndroid: Difference between Parcelable and Serializable?Parcelable where/when is describeContents() used?How to read/write a boolean when implementing the Parcelable interface?How can I make my custom objects Parcelable?Parcelable and InheritanceActivity receives Null from Parcelable objectAndroid Parcelable in Kotlin: CREATOR not found on Parcelable data classKotlin - Property initialization using “by lazy” vs. “lateinit”How to implement parcelable with my custom class containing Hashmap and SparseArray?Android : Parcelable : Class not found when unmarshalling

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Why am I getting "Static method cannot be referenced from a non static context: String String.valueOf(Object)"?

Why is information "lost" when it got into a black hole?

What day is it again?

IC has pull-down resistors on SMBus lines?

How to avoid supervisors with prejudiced views?

What flight has the highest ratio of timezone difference to flight time?

Is French Guiana a (hard) EU border?

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Is there such a thing as a proper verb, like a proper noun?

how one can write a nice vector parser, something that does pgfvecparseA=B-C; D=E x F;

Is dried pee considered dirt?

"Eavesdropping" vs "Listen in on"

In the "Harry Potter and the Order of the Phoenix" video game, what potion is used to sabotage Umbridge's speakers?

What is the process for purifying your home if you believe it may have been previously used for pagan worship?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Inductor and Capacitor in Parallel

What's the commands of Cisco query bgp neighbor table, bgp table and router table?

Free fall ellipse or parabola?

What does "shotgun unity" refer to here in this sentence?

Aggressive Under-Indexing and no data for missing index

Does Germany produce more waste than the US?

Can I board the first leg of the flight without having final country's visa?

What CSS properties can the br tag have?



How to parcelize Google's Place class?



The Next CEO of Stack OverflowAndroid: Difference between Parcelable and Serializable?Parcelable where/when is describeContents() used?How to read/write a boolean when implementing the Parcelable interface?How can I make my custom objects Parcelable?Parcelable and InheritanceActivity receives Null from Parcelable objectAndroid Parcelable in Kotlin: CREATOR not found on Parcelable data classKotlin - Property initialization using “by lazy” vs. “lateinit”How to implement parcelable with my custom class containing Hashmap and SparseArray?Android : Parcelable : Class not found when unmarshalling










0















in my custom object, i have 7 attributes, 5 of them are strings, and were auto genereated in the contructor fine, but the other two did not generate automatically. the last two are of class Place and ArrayList<int>:



class Spot() : Parcelable{
private var uid: String? = null
private var timeFrom: String? = null
private var timeTo: String? = null
private var rate: String? = null
private var description: String? = null
private var place: Place? = null
private var days : ArrayList<Int>? = null

constructor(parcel: Parcel) : this()
uid = parcel.readString()
timeFrom = parcel.readString()
timeTo = parcel.readString()
rate = parcel.readString()
description = parcel.readString()

...


How do i parcelize them?










share|improve this question


























    0















    in my custom object, i have 7 attributes, 5 of them are strings, and were auto genereated in the contructor fine, but the other two did not generate automatically. the last two are of class Place and ArrayList<int>:



    class Spot() : Parcelable{
    private var uid: String? = null
    private var timeFrom: String? = null
    private var timeTo: String? = null
    private var rate: String? = null
    private var description: String? = null
    private var place: Place? = null
    private var days : ArrayList<Int>? = null

    constructor(parcel: Parcel) : this()
    uid = parcel.readString()
    timeFrom = parcel.readString()
    timeTo = parcel.readString()
    rate = parcel.readString()
    description = parcel.readString()

    ...


    How do i parcelize them?










    share|improve this question
























      0












      0








      0








      in my custom object, i have 7 attributes, 5 of them are strings, and were auto genereated in the contructor fine, but the other two did not generate automatically. the last two are of class Place and ArrayList<int>:



      class Spot() : Parcelable{
      private var uid: String? = null
      private var timeFrom: String? = null
      private var timeTo: String? = null
      private var rate: String? = null
      private var description: String? = null
      private var place: Place? = null
      private var days : ArrayList<Int>? = null

      constructor(parcel: Parcel) : this()
      uid = parcel.readString()
      timeFrom = parcel.readString()
      timeTo = parcel.readString()
      rate = parcel.readString()
      description = parcel.readString()

      ...


      How do i parcelize them?










      share|improve this question














      in my custom object, i have 7 attributes, 5 of them are strings, and were auto genereated in the contructor fine, but the other two did not generate automatically. the last two are of class Place and ArrayList<int>:



      class Spot() : Parcelable{
      private var uid: String? = null
      private var timeFrom: String? = null
      private var timeTo: String? = null
      private var rate: String? = null
      private var description: String? = null
      private var place: Place? = null
      private var days : ArrayList<Int>? = null

      constructor(parcel: Parcel) : this()
      uid = parcel.readString()
      timeFrom = parcel.readString()
      timeTo = parcel.readString()
      rate = parcel.readString()
      description = parcel.readString()

      ...


      How do i parcelize them?







      arraylist kotlin google-places-api parcelable parcel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 18:28









      BarcodeBarcode

      9811




      9811






















          1 Answer
          1






          active

          oldest

          votes


















          0














          There are several methods to do it. You need to add the code yourself for ArrayList and Place Object in the constructor and writeToParcel methods.



          constructor



          constructor(parcel: Parcel) : this() 
          uid = parcel.readString()
          timeFrom = parcel.readString()
          timeTo = parcel.readString()
          rate = parcel.readString()
          description = parcel.readString()

          // Add the below to line of code
          days = parcel.readArrayList(Int::class.java.classLoader) as ArrayList<Int>?
          place = parcel.readParcelable<Place>(Place::class.java.classLoader)



          writeToParcel



          override fun writeToParcel(parcel: Parcel, flags: Int) 
          parcel.writeString(uid)
          parcel.writeString(timeFrom)
          parcel.writeString(timeTo)
          parcel.writeString(rate)
          parcel.writeString(description)

          // Add the below to line of code
          parcel.writeList(days)
          parcel.writeParcelable(place, flags)




          And if I'm not wrong, Googles Place class is already Parcelable so this code should work.



          Hope it helps!






          share|improve this answer

























          • .readParcelable<Place> gives error: Type argument is not within its bounds, Expected Parcelable!, Found Place

            – Barcode
            Mar 8 at 17:09











          • which Place object are you using? It's saying the Place class is not Parcelable. I have used this Google Place Object.

            – bhavya_karia
            Mar 9 at 5:12











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050546%2fhow-to-parcelize-googles-place-class%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          There are several methods to do it. You need to add the code yourself for ArrayList and Place Object in the constructor and writeToParcel methods.



          constructor



          constructor(parcel: Parcel) : this() 
          uid = parcel.readString()
          timeFrom = parcel.readString()
          timeTo = parcel.readString()
          rate = parcel.readString()
          description = parcel.readString()

          // Add the below to line of code
          days = parcel.readArrayList(Int::class.java.classLoader) as ArrayList<Int>?
          place = parcel.readParcelable<Place>(Place::class.java.classLoader)



          writeToParcel



          override fun writeToParcel(parcel: Parcel, flags: Int) 
          parcel.writeString(uid)
          parcel.writeString(timeFrom)
          parcel.writeString(timeTo)
          parcel.writeString(rate)
          parcel.writeString(description)

          // Add the below to line of code
          parcel.writeList(days)
          parcel.writeParcelable(place, flags)




          And if I'm not wrong, Googles Place class is already Parcelable so this code should work.



          Hope it helps!






          share|improve this answer

























          • .readParcelable<Place> gives error: Type argument is not within its bounds, Expected Parcelable!, Found Place

            – Barcode
            Mar 8 at 17:09











          • which Place object are you using? It's saying the Place class is not Parcelable. I have used this Google Place Object.

            – bhavya_karia
            Mar 9 at 5:12















          0














          There are several methods to do it. You need to add the code yourself for ArrayList and Place Object in the constructor and writeToParcel methods.



          constructor



          constructor(parcel: Parcel) : this() 
          uid = parcel.readString()
          timeFrom = parcel.readString()
          timeTo = parcel.readString()
          rate = parcel.readString()
          description = parcel.readString()

          // Add the below to line of code
          days = parcel.readArrayList(Int::class.java.classLoader) as ArrayList<Int>?
          place = parcel.readParcelable<Place>(Place::class.java.classLoader)



          writeToParcel



          override fun writeToParcel(parcel: Parcel, flags: Int) 
          parcel.writeString(uid)
          parcel.writeString(timeFrom)
          parcel.writeString(timeTo)
          parcel.writeString(rate)
          parcel.writeString(description)

          // Add the below to line of code
          parcel.writeList(days)
          parcel.writeParcelable(place, flags)




          And if I'm not wrong, Googles Place class is already Parcelable so this code should work.



          Hope it helps!






          share|improve this answer

























          • .readParcelable<Place> gives error: Type argument is not within its bounds, Expected Parcelable!, Found Place

            – Barcode
            Mar 8 at 17:09











          • which Place object are you using? It's saying the Place class is not Parcelable. I have used this Google Place Object.

            – bhavya_karia
            Mar 9 at 5:12













          0












          0








          0







          There are several methods to do it. You need to add the code yourself for ArrayList and Place Object in the constructor and writeToParcel methods.



          constructor



          constructor(parcel: Parcel) : this() 
          uid = parcel.readString()
          timeFrom = parcel.readString()
          timeTo = parcel.readString()
          rate = parcel.readString()
          description = parcel.readString()

          // Add the below to line of code
          days = parcel.readArrayList(Int::class.java.classLoader) as ArrayList<Int>?
          place = parcel.readParcelable<Place>(Place::class.java.classLoader)



          writeToParcel



          override fun writeToParcel(parcel: Parcel, flags: Int) 
          parcel.writeString(uid)
          parcel.writeString(timeFrom)
          parcel.writeString(timeTo)
          parcel.writeString(rate)
          parcel.writeString(description)

          // Add the below to line of code
          parcel.writeList(days)
          parcel.writeParcelable(place, flags)




          And if I'm not wrong, Googles Place class is already Parcelable so this code should work.



          Hope it helps!






          share|improve this answer















          There are several methods to do it. You need to add the code yourself for ArrayList and Place Object in the constructor and writeToParcel methods.



          constructor



          constructor(parcel: Parcel) : this() 
          uid = parcel.readString()
          timeFrom = parcel.readString()
          timeTo = parcel.readString()
          rate = parcel.readString()
          description = parcel.readString()

          // Add the below to line of code
          days = parcel.readArrayList(Int::class.java.classLoader) as ArrayList<Int>?
          place = parcel.readParcelable<Place>(Place::class.java.classLoader)



          writeToParcel



          override fun writeToParcel(parcel: Parcel, flags: Int) 
          parcel.writeString(uid)
          parcel.writeString(timeFrom)
          parcel.writeString(timeTo)
          parcel.writeString(rate)
          parcel.writeString(description)

          // Add the below to line of code
          parcel.writeList(days)
          parcel.writeParcelable(place, flags)




          And if I'm not wrong, Googles Place class is already Parcelable so this code should work.



          Hope it helps!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 8 at 7:56

























          answered Mar 8 at 7:21









          bhavya_kariabhavya_karia

          6817




          6817












          • .readParcelable<Place> gives error: Type argument is not within its bounds, Expected Parcelable!, Found Place

            – Barcode
            Mar 8 at 17:09











          • which Place object are you using? It's saying the Place class is not Parcelable. I have used this Google Place Object.

            – bhavya_karia
            Mar 9 at 5:12

















          • .readParcelable<Place> gives error: Type argument is not within its bounds, Expected Parcelable!, Found Place

            – Barcode
            Mar 8 at 17:09











          • which Place object are you using? It's saying the Place class is not Parcelable. I have used this Google Place Object.

            – bhavya_karia
            Mar 9 at 5:12
















          .readParcelable<Place> gives error: Type argument is not within its bounds, Expected Parcelable!, Found Place

          – Barcode
          Mar 8 at 17:09





          .readParcelable<Place> gives error: Type argument is not within its bounds, Expected Parcelable!, Found Place

          – Barcode
          Mar 8 at 17:09













          which Place object are you using? It's saying the Place class is not Parcelable. I have used this Google Place Object.

          – bhavya_karia
          Mar 9 at 5:12





          which Place object are you using? It's saying the Place class is not Parcelable. I have used this Google Place Object.

          – bhavya_karia
          Mar 9 at 5:12



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050546%2fhow-to-parcelize-googles-place-class%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved