Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8081351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:42:16+00:00 2026-06-05T16:42:16+00:00

I am send data from one service to other service using parecable, when I

  • 0

I am
send data from one service to other service using parecable, when I write data contains proper value but when read data from parcelable it return null values.

can any one tell me what is the problem with this code?

Parcelable class

package com.airwatch.agent.finddevice;

import android.os.Parcel;
import android.os.Parcelable;


/**
 * Represents the configuration supplied from device services 
 * regarding the  find device command.
 */
public class FindDeviceConfig implements Parcelable{
    public FindDeviceConfig() {
    }

    /**
     * number of loops to play ring-tone.
     */
    private String numberoftime;

    /**
     * Delay between loops - in seconds.
     */
    private String interval;

    public FindDeviceConfig(String numberoftime, String interval) {
        this.numberoftime = numberoftime;
        this.interval = interval;
    }

    public String getNumberoftime() {
        return numberoftime;
    }

    public void setNumberoftime(String numberoftime) {
        this.numberoftime = numberoftime;
    }

    public String getInterval() {
        return interval;
    }

    public void setInterval(String interval) {
        this.interval = interval;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel dest, int flags) {
        //dest.writeInt(Integer.parseInt(numberoftime));

        //dest.writeInt(Integer.parseInt(interval));
        dest.writeString(this.interval);
        dest.writeString(this.numberoftime);
    }

    public static final Parcelable.Creator<FindDeviceConfig> CREATOR = new Parcelable.Creator<FindDeviceConfig>() {
        public FindDeviceConfig createFromParcel(Parcel in) {
            return new FindDeviceConfig(in);
        }

        public FindDeviceConfig[] newArray(int size) {
            return new FindDeviceConfig[size];
        }
    };

    public FindDeviceConfig(Parcel parcel)
    {
        parcel.setDataPosition(0);

        interval=parcel.readString();
        numberoftime=parcel.readString();

    }
}

Putting the parcelable object.

FindDeviceConfig config=new FindDeviceConfig("3","2");
intent.putExtra("finddevice_config", config);

Reading the parcelable object.

FindDeviceConfig config = intent.getParcelableExtra("finddevice_config");

Anyone faced this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:42:18+00:00Added an answer on June 5, 2026 at 4:42 pm

    add the following constructor:

    public FindDeviceConfig(Parcel data) {
        this.numberoftime  = data.readString();
        this.interval = data.readString();
     } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm tying to send POST data from one site to another (both sites have
I am trying to send data from an activity to service via intents. This
I am using socket to send data from local machine to remote in TCP,
I'm using the program to send data from database to the Excel file .
I need to send large binary(2Gb-10Gb) data from one pc(client) to another pc(server) over
I am trying to send data from PHP Client to Python Server. CLIENT <?php
I am currently trying to send some data from and Android application to a
I'd like to send data to browser from server (website). For example on SO
i am working with JSON to send data to and from my server ,
I send binary data over websocket from python server: data = struct.pack('!BI', 2, 1)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.