Firebase real database values differ from the retrieved ones - android

So, in realtime database I have:
When I retrieve data from database I get:
Model class looks like:
public class User implements Parcelable {
public static final Parcelable.Creator<User> CREATOR = new Parcelable.Creator<User>() {
#Override
public User createFromParcel(Parcel source) {
return new User(source);
}
#Override
public User[] newArray(int size) {
return new User[size];
}
};
...
private String hasToPayFromPastRides;
private String didNotPayCount;
...;
public User() {
}
public User(..., String didNotPayCount, String hasToPayFromPastRides) {
...
this.didNotPayCount = didNotPayCount;
this.hasToPayFromPastRides = hasToPayFromPastRides;
}
protected User(Parcel in) {
...
this.didNotPayCount = in.readString();
this.hasToPayFromPastRides = in.readString();
}
...
public String getDidNotPayCount() {
return didNotPayCount;
}
public void setDidNotPayCount(String didNotPayCount) {
this.didNotPayCount = didNotPayCount;
}
public String hasToPayFromPastRides() {
return hasToPayFromPastRides;
}
public void setHasToPayFromPastRides(String hasToPayFromPastRides) {
this.hasToPayFromPastRides = hasToPayFromPastRides;
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.userId);
dest.writeString(this.userFullName);
dest.writeString(this.userEmail);
dest.writeString(this.userPhoneNumber);
dest.writeString(this.userAvatarUrl);
dest.writeString(this.userLocalAvatar);
dest.writeString(this.userAddress);
dest.writeString(this.userCity);
dest.writeString(this.userArea);
dest.writeString(this.userPostalCode);
dest.writeString(this.userRating);
dest.writeString(this.userTotalRating);
dest.writeString(this.totalTrips);
dest.writeString(this.riskCount);
dest.writeString(this.isBlocked);
dest.writeString(this.isDefaulter);
dest.writeString(this.pendingRating);
dest.writeParcelable(this.pendingRateObj, flags);
dest.writeString(this.didNotPayCount);
dest.writeString(this.hasToPayFromPastRides);
}
}
What surprises me is that one value gets read correctly "didNotPayCount" when "hasToPayFromPastRides" is null. Any ideas?

Your getter isn't named correctly:
public String hasToPayFromPastRides()
It should be:
public String getHasToPayFromPastRides()

Related

How to send ArrayList<Object> to other Fragment/Activity without init (start) the next Activity?

I have an ArrayList and I need to send it to another fragment. I tried to use Parcelable, but to send the data I need the "startIntent" method which starts the fragment. I don't want the fragment to be started.
I need send data array list object to another fragment without going to this other fragment. I only need to send the data. The user is free to chose when to change between activities/fragments. And the data sent earlier should already be there.
Example using Parcelable:
Class that must be to sent:
import android.os.Parcel;
import android.os.Parcelable;
public class Doenca implements Parcelable {
private String nome;
private String causa;
private String efeito;
private String cuidados;
private String prevencao;
private String categoria;
public Doenca(String nome, String causa, String efeito, String cuidados, String prevencao, String categoria) {
this.nome = nome;
this.causa = causa;
this.efeito = efeito;
this.cuidados = cuidados;
this.prevencao = prevencao;
this.categoria = categoria;
}
protected Doenca(Parcel in) {
nome = in.readString();
causa = in.readString();
efeito = in.readString();
cuidados = in.readString();
prevencao = in.readString();
categoria = in.readString();
}
public static final Creator<Doenca> CREATOR = new Creator<Doenca>() {
#Override
public Doenca createFromParcel(Parcel in) {
return new Doenca(in);
}
#Override
public Doenca[] newArray(int size) {
return new Doenca[size];
}
};
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCausa() {
return causa;
}
public void setCausa(String causa) {
this.causa = causa;
}
public String getEfeito() {
return efeito;
}
public void setEfeito(String efeito) {
this.efeito = efeito;
}
public String getCuidados() {
return cuidados;
}
public void setCuidados(String cuidados) {
this.cuidados = cuidados;
}
public String getPrevencao() {
return prevencao;
}
public void setPrevencao(String prevencao) {
this.prevencao = prevencao;
}
public String getCategoria() {
return categoria;
}
public void setCategoria(String categoria) {
this.categoria = categoria;
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(nome);
dest.writeString(causa);
dest.writeString(efeito);
dest.writeString(cuidados);
dest.writeString(prevencao);
dest.writeString(categoria);
}
}
import android.os.Parcel;
import android.os.Parcelable;
public class Doenca implements Parcelable {
private String nome;
private String causa;
private String efeito;
private String cuidados;
private String prevencao;
private String categoria;
public Doenca(String nome, String causa, String efeito, String cuidados, String prevencao, String categoria) {
this.nome = nome;
this.causa = causa;
this.efeito = efeito;
this.cuidados = cuidados;
this.prevencao = prevencao;
this.categoria = categoria;
}
protected Doenca(Parcel in) {
nome = in.readString();
causa = in.readString();
efeito = in.readString();
cuidados = in.readString();
prevencao = in.readString();
categoria = in.readString();
}
public static final Creator<Doenca> CREATOR = new Creator<Doenca>() {
#Override
public Doenca createFromParcel(Parcel in) {
return new Doenca(in);
}
#Override
public Doenca[] newArray(int size) {
return new Doenca[size];
}
};
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCausa() {
return causa;
}
public void setCausa(String causa) {
this.causa = causa;
}
public String getEfeito() {
return efeito;
}
public void setEfeito(String efeito) {
this.efeito = efeito;
}
public String getCuidados() {
return cuidados;
}
public void setCuidados(String cuidados) {
this.cuidados = cuidados;
}
public String getPrevencao() {
return prevencao;
}
public void setPrevencao(String prevencao) {
this.prevencao = prevencao;
}
public String getCategoria() {
return categoria;
}
public void setCategoria(String categoria) {
this.categoria = categoria;
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(nome);
dest.writeString(causa);
dest.writeString(efeito);
dest.writeString(cuidados);
dest.writeString(prevencao);
dest.writeString(categoria);
}
}
There are multiple ways with different complexity for the implementation.
Use a database to store what you need there
Store the data in the host activity containing the tabs. As soon as you switch the fragment, all you need to do is read the data from the place where you have stored it.
Use LiveData. LiveData would be my personal preference. There you can easily store any data you need and the second fragment simply observes the livedata and can easily react to changes. So you could even switch in both directions as often as you want to.
Try Using EventBus.
To use EventBus, you need to first add it to in the app module build.gradle file
implementation 'org.greenrobot:eventbus:3.1.1'
and then sync your project.
An Event Subscriber
A subscriber simply subscribes to an event by registering in the event bus and can also unregister that event. To be a subscriber, you have to do three main things:
Register the subscriber in the event bus with register(). This informs the event bus that you want to begin receiving events. In an activity, this is in the onStart() method, while in a fragment put this in the onAttact(Activity activity) method.
#Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
Unregister the subscriber, which means tell the event bus to stop sending me events. In an activity, this is in the onStop() method, while in a fragment put this in the onDetach() method.
#Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
Implement the onEvent() to indicate the type of event you want to receive and action to take when you receive the event. Notice the #Subscribe annotation at the top of this method.
#Subscribe
public void onEvent(MessageEvent event) {
Toast.makeText(this, "Hey, my message" + event.getMessage(),
Toast.LENGTH_SHORT).show();.
}
Defining Event Messages
The events in greenrobot EventBus are just objects that you define. You can have different event classes if you want. They do not inherit any base class or interface—they're just POJO (Plain Old Java Objects).
public class MessageEvent {
public final List<SomeItem> items;
public MessageEvent(List<SomeItem> items) {
this.items= items;
}
}
Post Event
EventBus.getDefault().post(new MessageEvent("Hey event subscriber!"));

Trying to add relations in Backendless. No error but total count of relations added is always 0

Hi guys I am trying to save objects with relations in Backendless via API. I have two classes namely Task and Reminder. A task can be associated with many reminders hence I want a 1:N relationship between the Task table and Reminder table in Backendless. My Task class is as follows:
public class Task {
public Date created;
public Date updated;
private List<Reminder> reminders = null;
private String ownerId;
#PrimaryKey
#NonNull
private String objectId;
#NonNull
private String taskTitle;
#NonNull
private Date deadline;
#NonNull
private int isCompleted = 0;
#NonNull
private int isExpired = 0;
public String getOwnerId() {
return ownerId;
}
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
#NonNull
public String getObjectId() {
return objectId;
}
public void setObjectId(#NonNull String objectId) {
this.objectId = objectId;
}
public List<Reminder> getReminders() {
return reminders;
}
public void setReminders(List<Reminder> reminders) {
this.reminders = reminders;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getUpdated() {
return updated;
}
public void setUpdated(Date updated) {
this.updated = updated;
}
#NonNull
public int getIsCompleted() {
return isCompleted;
}
public void setIsCompleted(#NonNull int isCompleted) {
this.isCompleted = isCompleted;
}
#NonNull
public int getIsExpired() {
return isExpired;
}
public void setIsExpired(#NonNull int isExpired) {
this.isExpired = isExpired;
}
public String getTaskTitle() {
return taskTitle;
}
public void setTaskTitle(String taskTitle) {
this.taskTitle = taskTitle;
}
public Date getDeadline() {
return deadline;
}
public void setDeadline(Date deadline) {
this.deadline = deadline;
}
}
Reminder Class:
public class Reminder {
private String title;
private Date time;
private String objectId;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public String getObjectId() {
return objectId;
}
public void setObjectId(String objectId) {
this.objectId = objectId;
}
}
I am saving the objects and setting up the relation as below:
public void saveTaskToServer(final Task task) {
List<Reminder> remindersList = new ArrayList<>();
remindersList = task.getReminders();
final List<Reminder> savedReminders = new ArrayList<>();
if(remindersList!=null && remindersList.size()!=0) {
for
(Reminder reminder : remindersList) {
reminder.setTitle(task.getTaskTitle());
Backendless.Persistence.save(reminder, new AsyncCallback<Reminder>() {
#Override
public void handleResponse(Reminder response) {
savedReminders.add(response);
}
#Override
public void handleFault(BackendlessFault fault) {
Log.i("error saving remidners", fault.toString());
}
});
}
}
Backendless.Persistence.save(task, new AsyncCallback<Task>() {
#Override
public void handleResponse(Task response) {
newTask = response;
Log.i("id is ", newTask.getObjectId());
insertTask(response);
snackbarMessage.postValue("Task Created Successfully.");
}
#Override
public void handleFault(BackendlessFault fault) {
Log.i("error", fault.getMessage());
}
});
Backendless.Persistence.of(Task.class).addRelation(task, "reminders", savedReminders, new AsyncCallback<Integer>() {
#Override
public void handleResponse(Integer response) {
Log.i("response", "added" + response);
newTask.setReminders(savedReminders);
}
#Override
public void handleFault(BackendlessFault fault) {
Log.i("response", "error" + fault.toString());
}
});
}
I have tried saving the relation using the tablename:Class:n instead of the parentColumnName. Also tried saving the objectids of the reminders instead of the reminder objects themselves.The task and reminder objects get saved properly in the backendless console in their respective tables but the reminder column in the Task table still remains empty and no relations get added. Relations count in the backendless call in Android Studio also returns 0. Any advice is really appreciated. I have been following this example.
My relations were not getting saved because I was using the async callbacks in backendless!! I dont know why I didnt see that before. Since the save calls were being made before the async callbacks could finish I was ending up with null values. Fixed it by making the calls synchronous and wrapping them in an async task.

java.lang.ClassCastException while sending Parcelable[] as Intent extra

I am sending an array of TutorAccount as an intent extra to another Activity. Here are the TutorAccount and Account classes involved:
public class TutorAccount extends Account{
public TutorAccount(TutorProfile profile) {
super(profile);
}
public TutorAccount(TutorProfile profile, LocationInfo locationInfo) {
super(profile, locationInfo);
}
public TutorProfile getProfile() {
return (TutorProfile) super.getProfile();
}
public void setProfile(TutorProfile profile) {
super.setProfile(profile);
}
}
and the Account class,
public class Account implements Parcelable {
/**Email Id of the User */
private String mEmailID;
/**Important to have the status indexed as this shall be used during a query for a particular user type*/
private Integer accountStatus;
// Profile info.
private GenericLearnerProfile profile;
// Tutor's location info. - this would be computed from {Latitude, Longitude} which shall be available
// from the _1 info. Also, this holds a reference to the LatLng{Latitude, Longitude} from the _1.
private LocationInfo locationInfo;
public Account(GenericLearnerProfile profile) {
if(profile == null){
throw new NullPointerException("Profile can't be null");
}
this.profile = profile;
mEmailID = profile.getEmailID();
// Auto boxing
this.accountStatus = profile.getCurrentStatus();
}
public Account(GenericLearnerProfile profile, LocationInfo locationInfo) {
if(profile == null){
throw new NullPointerException("Profile can't be null");
}
this.profile = profile;
this.locationInfo = locationInfo;
mEmailID = profile.getEmailID();
this.accountStatus = profile.getCurrentStatus();
}
private Account(){
}
public GenericLearnerProfile getProfile() {
return profile;
}
public void setProfile(GenericLearnerProfile profile) {
if(profile == null){
throw new NullPointerException("Profile can't be null");
}
this.profile = profile;
mEmailID = profile.getEmailID();
}
public LocationInfo getLocationInfo() {
return locationInfo;
}
public void setLocationInfo(LocationInfo locationInfo) {
this.locationInfo = locationInfo;
}
public static class LocationInfo implements Parcelable {
private String shortFormattedAddress;
public LocationInfo(String shortFormattedAddress) {
this.shortFormattedAddress = shortFormattedAddress;
}
public String getShortFormattedAddress() {
return shortFormattedAddress;
}
public void setShortFormattedAddress(String shortFormattedAddress) {
this.shortFormattedAddress = shortFormattedAddress;
}
protected LocationInfo(Parcel in) {
shortFormattedAddress = in.readString();
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(shortFormattedAddress);
}
#SuppressWarnings("unused")
public static final Parcelable.Creator<LocationInfo> CREATOR = new Parcelable.Creator<LocationInfo>() {
#Override
public LocationInfo createFromParcel(Parcel in) {
return new LocationInfo(in);
}
#Override
public LocationInfo[] newArray(int size) {
return new LocationInfo[size];
}
};
}
protected Account(Parcel in) {
mEmailID = in.readString();
accountStatus = in.readByte() == 0x00 ? null : in.readInt();
profile = (GenericLearnerProfile) in.readValue(GenericLearnerProfile.class.getClassLoader());
locationInfo = (LocationInfo) in.readValue(LocationInfo.class.getClassLoader());
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mEmailID);
if (accountStatus == null) {
dest.writeByte((byte) (0x00));
} else {
dest.writeByte((byte) (0x01));
dest.writeInt(accountStatus);
}
dest.writeValue(profile);
dest.writeValue(locationInfo);
}
#SuppressWarnings("unused")
public static final Parcelable.Creator<Account> CREATOR = new Parcelable.Creator<Account>() {
#Override
public Account createFromParcel(Parcel in) {
return new Account(in);
}
#Override
public Account[] newArray(int size) {
return new Account[size];
}
};
}
You can see that TutorAccount extends Account. Here is the stack trace of the exception:
java.lang.ClassCastException: com.learncity.generic.learner.account.Account cannot be cast to com.learncity.tutor.account.TutorAccount
at com.learncity.learner.search.SearchResultsActivity.onCreate(SearchResultsActivity.java:48)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6077) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
It is saying Account cannot be casted to TutorAccount. I am not sure how Account even came into casting scenarion as it is supposed to be Parcelable to TutorAccount cast.
Here is the code used to send and receive the Intent extra:
Sending Activity
// Show these accounts in a list view
Intent i = new Intent(this, SearchResultsActivity.class);
i.putExtra(SEARCHED_ACCOUNTS, refactorAccountsToArray(accounts));
startActivity(i);
Receiving Activity
List<TutorAccount> list = new ArrayList<>(10);
for(Parcelable p : getIntent ().getParcelableArrayExtra(SEARCHED_ACCOUNTS)){
list.add((TutorAccount)p);
}
I have tried Logging the p - the Parcelable in the receiving activity and it shows it being an instance of Account. I am not sure how this is happening. Has anyone faced this?
EDIT:
The List<TutorAccount> accounts that I am receiving in the argument here is a different class to model backend JSON data.
Here is the refactorAccountsToArray() method:
private List<com.learncity.tutor.account.TutorAccount> refactorAccountsToList(List<TutorAccount> accounts){
// Extract the list of accounts from backend
List<TutorProfileVer1> profiles = new ArrayList<TutorProfileVer1>();
List<Account.LocationInfo> locationInfos = new ArrayList<Account.LocationInfo>();
for(TutorAccount acc : accounts){
profiles.add(acc.getProfile());
locationInfos.add(new Account.LocationInfo((acc.getLocationInfo() == null ? null: acc.getLocationInfo().getShortFormattedAddress())));
}
// Populate a profile model
List<com.learncity.tutor.account.TutorAccount> acc = new ArrayList<com.learncity.tutor.account.TutorAccount>();
List<TutorProfile> refactoredProfiles = TutorProfile.populateProfilesFromEntities(profiles);
int i = 0;
for(TutorProfile p : refactoredProfiles){
com.learncity.tutor.account.TutorAccount t = new com.learncity.tutor.account.TutorAccount(p);
t.setLocationInfo(new Account.LocationInfo(locationInfos.get(i).getShortFormattedAddress()));
acc.add(t);
i++;
}
return acc;
}
private com.learncity.tutor.account.TutorAccount[] refactorAccountsToArray(List<TutorAccount> accounts){
List<com.learncity.tutor.account.TutorAccount> refactoredProfiles = refactorAccountsToList(accounts);
return refactoredProfiles.toArray(new com.learncity.tutor.account.TutorAccount[refactoredProfiles.size()]);
}
As per the advice by #AnhaytAnanun Turns out that for even a cast, a creator is required for a Parcelable entity. My code works now with the inclusion of CREATOR and other Parcelable methods. Here is the revised code:
package com.learncity.tutor.account;
import android.os.Parcel;
import android.os.Parcelable;
import com.learncity.generic.learner.account.Account;
import com.learncity.tutor.account.profile.model.TutorProfile;
/**
* Created by DJ on 3/7/2017.
*/
public class TutorAccount extends Account{
public TutorAccount(TutorProfile profile) {
super(profile);
}
public TutorAccount(TutorProfile profile, LocationInfo locationInfo) {
super(profile, locationInfo);
}
public TutorProfile getProfile() {
return (TutorProfile) super.getProfile();
}
public void setProfile(TutorProfile profile) {
super.setProfile(profile);
}
public TutorAccount(Parcel in) {
super(in);
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
}
#SuppressWarnings("unused")
public static final Parcelable.Creator<TutorAccount> CREATOR = new Parcelable.Creator<TutorAccount>() {
#Override
public TutorAccount createFromParcel(Parcel in) {
return new TutorAccount(in);
}
#Override
public TutorAccount[] newArray(int size) {
return new TutorAccount[size];
}
};
}

How to make nested ArrayLists parcelable

To pass an arrayList of objects to a fragment, I have to make the list objects parcelable.
public mObjectClass implements Parcelable {
// Some code
}
The problem is that one of the attributes in my list objects is another object-based arrayList.
public mObjectClass implements Parcelable {
// Some code
private ArrayList<someOtherObject> anotherArrayList;
}
How can I make mObjectClass parcelable?
someOtherObject has to implement Parcelable (not extend has in your question) too. Then you can call parcel.writeTypedList(anotherArrayList); to write it and parcel.readTypedList(yourList, someOtherObject.CREATOR) to read it back. You can read more here
This solution is heavily influenced by some Stackoverflow posts, including
this.
Essentially make both Classes parcelable and make use of someOtherClasses Parcelable.Creator.
mObjectClass:
public class mObjectClass implements Parcelable {
private ArrayList<someOtherObject> anotherArrayList;
//add getter + setter...
public mObjectClass() {
anotherArrayList = new ArrayList<someOtherObject>();
}
public mObjectClass(Parcel in) {
anotherArrayList = new ArrayList<someOtherObject>();
in.readTypedList(anotherArrayList, someOtherObject.CREATOR);
}
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel outParcel, int flags) {
outParcel.writeTypedList(anotherArrayList);
}
public static final Parcelable.Creator<MyParcelable> CREATOR = new Parcelable.Creator<MyParcelable>() {
#Override
public mObjectClass createFromParcel(Parcel in) {
return new mObjectClass(in);
}
#Override
public mObjectClass[] newArray(int size) {
return new mObjectClass[size];
}
};
}
someOtherObject:
public class someOtherObject implements Parcelable {
String someString;
//add getter + setter...
public void writeToParcel(Parcel out, int flags) {
out.writeString(someString);
}
public static final Parcelable.Creator<someOtherObject> CREATOR = new Parcelable.Creator<someOtherObject>() {
public someOtherObject createFromParcel(Parcel in) {
return new someOtherObject(in);
}
public someOtherObject[] newArray(int size) {
return new someOtherObject[size];
}
};
public int describeContents() {
return 0;
}
public someOtherObject(Parcel in) {
someString = in.readString();
}
public someOtherObject() {
}
public someOtherObject(String someString) {
this.someString = someString;
}
}
Tada, you are now able to add mObjectClass as extra to your intents after initialising it and using a setter to set the Arraylist with other someOtherObjects.

creating parcelable in android from some of the fields of a class

i have the following class which i intent to pass from one activity to another:
public class Ad extends ListItem implements parcelable{
private String _type;
private String _recordID;
private String _line1;
private String _line2;
private String _line3;
private String _line4;
private String _url;
private IOnUiNeedToUpdateListener _listener;
private boolean _notActive = false;
private String _alertText;
private Double _longitude;
private Double _latitude;
}
i want to pass an array of such objects from one activity to another. however, i do not need to pass all fields.
is it possible to create a parcel only from the desired fields and send it?
It's your code that writes to Parcel and your code that reads from Parcel. So basically yes. You can write whatever you want. Content of all members, content of some, no members, but other values you use to restore state of the object etc, etc.
Try design your class like this..
public class Form implements Parcelable {
private String formdata1;
private String formdata2;
private String formdata3;
private String formdata4;
public Form() {
}
public Form(Parcel in) {
setFormdata1(in.readString());
setFormdata2(in.readString());
setFormdata3(in.readString());
setFormdata4(in.readString());
}
public String getFormdata1() {
return formdata1;
}
public void setFormdata1(String formdata1) {
this.formdata1 = formdata1;
}
public String getFormdata2() {
return formdata2;
}
public void setFormdata2(String formdata2) {
this.formdata2 = formdata2;
}
public String getFormdata3() {
return formdata3;
}
public void setFormdata3(String formdata3) {
this.formdata3 = formdata3;
}
public String getFormdata4() {
return formdata4;
}
public void setFormdata4(String formdata4) {
this.formdata4 = formdata4;
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel in, int arg1) {
in.writeString(getFormdata1());
in.writeString(getFormdata2());
in.writeString(getFormdata3());
in.writeString(getFormdata4());
}
public static final Parcelable.Creator<Form> CREATOR = new Parcelable.Creator<Form>() {
#Override
public Form createFromParcel(Parcel in) {
return new Form(in);
}
#Override
public Form[] newArray(int size) {
return new Form[size];
}
};
}

Categories

Resources