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

  • SEARCH
  • Home
  • 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 9064497
In Process

The Archive Base Latest Questions

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

I have a class called Weekly Result which implements Parcel interface. I am having

  • 0

I have a class called Weekly Result which implements Parcel interface. I am having a problem retrieving the parcel object when I pass it to another activity.

This is my weeklyResult class:

public class WeeklyTopicResult implements Parcelable {

public String ID;
public MultiLingual Title = new MultiLingual();
public MultiLingual Text = new MultiLingual();
public String ImageUrl;
public String PublishOn;
public Bitmap ImageSource;

public WeeklyTopicResult(Parcel in) {
    // Reads the obj value
    ReadFromParcel(in);

}

public WeeklyTopicResult() {
    // TODO Auto-generated constructor stub
}

@Override
public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
    // TODO Auto-generated method stub
    Log.v("WeekData", "WriteToParcel..." + flags);
    dest.writeString(ID);
    dest.writeString(ImageUrl);
    dest.writeString(PublishOn);
    dest.writeParcelable(Title, flags);
    dest.writeParcelable(Text, flags);
    dest.writeParcelable(ImageSource, flags);

}

public void ReadFromParcel(Parcel obj) {
    Log.v("WeeklyClaas",
            "ParcelData(Parcel source): time to put back parcel data");
    ID = obj.readString();
    Title = (MultiLingual) obj.readParcelable(MultiLingual.class
            .getClassLoader());
    Text = (MultiLingual) obj.readParcelable(MultiLingual.class
            .getClassLoader());
    ImageUrl = obj.readString();
    PublishOn = obj.readString();
    ImageSource = (Bitmap) obj
            .readParcelable(Bitmap.class.getClassLoader());

}

public class WeeklyTopicResultParcelCreater implements
        Parcelable.Creator<WeeklyTopicResult> {

    @Override
    public WeeklyTopicResult createFromParcel(Parcel source) {
        // TODO Auto-generated method stub
        return new WeeklyTopicResult(source);
    }

    @Override
    public WeeklyTopicResult[] newArray(int size) {
        // TODO Auto-generated method stub
        return new WeeklyTopicResult[size];
    }
}
}

This is my Multilinqual class:

public class MultiLingual implements Parcelable {

public String ArbicValue;

public String EnglishValue;

public MultiLingual(Parcel in) {
    ReadFromParcel(in);
}

public MultiLingual() {
    // TODO Auto-generated constructor stub
}

@Override
public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
    // TODO Auto-generated method stub
    dest.writeString(ArbicValue);
    dest.writeString(EnglishValue);

}

private void ReadFromParcel(Parcel Obj) {

    ArbicValue = Obj.readString();
    EnglishValue = Obj.readString();
}

public class MyMultiLingualParcelCreator implements
        Parcelable.Creator<MultiLingual> {

    @Override
    public MultiLingual createFromParcel(Parcel source) {
        // TODO Auto-generated method stub
        return new MultiLingual(source);
    }

    @Override
    public MultiLingual[] newArray(int size) {
        // TODO Auto-generated method stub
        return new MultiLingual[size];
    }

}
}

And here is where I am sending the object which intent:

public void GoToWeeklyTopic(View v) {
    Intent intent = new Intent();
    intent.setClass(HomeActivity.this, Topic_of_the_week.class);

    Bundle b = new Bundle();
    WeeklyTopicResult w = weeks;

    // Puts the weeklyresult parcel class into bundle
    b.putParcelable("WeeklyContent", w);

    intent.putExtras(b);
    startActivity(intent);
}

Here’s the activity class where I am trying to receive my parcel object:

ImageView weekImg;
TextView title;
TextView ContentText;
WeeklyTopicResult week= new WeeklyTopicResult();

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_topic_of_the_week);

    Bundle extras = getIntent().getExtras();
            //Here I am receiving an error
    week =extras.getParcelable("WeeklyContent");


    weekImg = (ImageView) findViewById(R.id.imageView1);
    title = (TextView) findViewById(R.id.txt_MainTitle);
    ContentText = (TextView) findViewById(R.id.txt_page_content_topicweek);

    title.setText(week.Title.EnglishValue);
    ContentText.setText(week.Text.EnglishValue);
    weekImg.setImageBitmap(week.ImageSource);
    // String FullPath = RetrieveData_Preference("WeeklyTopicUrl") + Url;
    // getImage(FullPath);

}

I even tried to cast the object back but still I am having an error. Logcat error showed me this error but I already implemented a creater class for weeklyresult

LogCat error:

FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity

ComponentInfo{com.example.laysapp/com.example.laysapp.AdminPage.Topic_of_the_week}:
android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called CREATOR on class com.example.laysapp.ParsingLogic.WeeklyTopicResult
E/AndroidRuntime(1231):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.os.BadParcelableException: Parcelable protocol requires a
Parcelable.Creator object called CREATOR on class
com.example.laysapp.ParsingLogic.WeeklyTopicResult
at android.os.Parcel.readParcelable(Parcel.java:2086)
at android.os.Parcel.readValue(Parcel.java:1965)
at android.os.Parcel.readMapInternal(Parcel.java:2226)
at android.os.Bundle.unparcel(Bundle.java:223)
at android.os.Bundle.getParcelable(Bundle.java:1165)
at com.example.laysapp.AdminPage.Topic_of_the_week.onCreate(
Topic_of_the_week.java:40)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
… 11 more

What am I doing wrong here?

  • 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-16T16:16:07+00:00Added an answer on June 16, 2026 at 4:16 pm

    From the documentation:

    Classes implementing the Parcelable interface must also have a static field called CREATOR, which is an object implementing the Parcelable.Creator interface.

    So add this field to your MultiLingual class:

    public static final MyMultiLingualParcelCreator CREATOR = new MyMultiLingualParcelCreator();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class called Product in my Business object and in another class
I have a class called IssuesView which implements INotifyPropertyChanged . This class holds an
I have a class called Trial which has_many results. Now What I want to
I have a class called Metadata, which is declared within the namespace A::B::C ,
I have a class called Flamethrower which naturally has its own ammunition that is
I have a class called Property which has nothing but get -methods. All the
I have a class called Path for which there are defined about 10 methods,
Have a class called events which is a many-to-one mapping to class location using
I have a class called ContentStream ... the problem is that the inner class
I have a class called SparseMatrix which contain a private vector of type Cell.

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.