parcelable

Serializable parcelable issue: RuntimeException: Parcelable encountered IOException writing serializable object

我与影子孤独终老i 提交于 2019-12-12 23:54:03
问题 Folks, I have simplest class which I want to be Parcelable. I'm doing it in following way: public class MyField implements Serializable, Parcelable { public MyField() { } //************************************************ // Parcelable methods //************************************************ public int describeContents() {return 0; }; public void writeToParcel(Parcel out, int flags) { out.writeInt(this.describeContents()); out.writeSerializable(this); } @SuppressWarnings("redundant") public

getParcelableExtra always null on Pending Intent, but not Intent

倾然丶 夕夏残阳落幕 提交于 2019-12-12 23:02:36
问题 I'm new to Java let alone Android development. I have no coding background, but thought I'd start with something 'simple' like an alarm clock. So now I'm writing an alarm clock, and I want to update the alarms to be inactive if they aren't repeating after they go off. When I pass a parcelable AlarmClass (my alarm object) to the alarm set screen with an intent, it passes just fine. When I pass the same AlarmClass to an intent, and put it in a PendingIntent in the Alarm Manager and then try to

Parcelable custom object losing instance values when passed with intent

不问归期 提交于 2019-12-12 18:29:17
问题 Ive come in to a problem that has me completely stumped beyond belief. My custom object seems to be losing the values after it is sent via intent to a new activity. Why would an object lose values of its instance variables only after being passed with intent? I have custom object that implements Parcelable, for storing specific data. public class Vehicle implements Parcelable, Serializable{ private static final String TAG = "vehicleObject"; public String vehicleType; public String refID;

NoSuchMethodError using @Parcelize Annotation in Kotlin

谁都会走 提交于 2019-12-12 10:45:57
问题 I'm currently trying out the experimental (which might be why it's not working...) @Parcelize annotation to generate Parcelable code. Most types seem to be working fine, but I'm having issues with Serializable s throwing a NoSuchMethodError : 10-05 13:55:18.549 20808-20808/com.app E/AndroidRuntime: FATAL EXCEPTION: main Process: com.app, PID: 20808 java.lang.NoSuchMethodError: No virtual method writeSerializable(Ljava/util/Date;)V in class Landroid/os/Parcel; or its super classes (declaration

Parcelable Issues When Obfuscating With Proguard

两盒软妹~` 提交于 2019-12-12 10:34:48
问题 My app works fine before obfuscation but when I enable proguard I get the following error: 2013-05-02 13:43:58.772 E 30138/AndroidRuntime: FATAL EXCEPTION: main java.lang.NumberFormatException: Invalid long: "0.20" at java.lang.Long.invalidLong(Long.java:125) at java.lang.Long.parse(Long.java:362) at java.lang.Long.parseLong(Long.java:353) at java.lang.Long.parseLong(Long.java:319) at com.sourcetone.data.model.Station.long getId()(SourceFile:195) at com.sourcetone.STStationListFragment.void

how to put and get intent of parcelable array list

喜欢而已 提交于 2019-12-12 06:51:29
问题 i try to send this zaznam Arraylist from one activity to second and it wont works.. first activity ArrayList<LatLng> zaznam = new ArrayList<LatLng>(); zaznam.add(new LatLng(66,55)); zaznam.add(new LatLng(44,77)); zaznam.add(new LatLng(11,99)); Intent intent2 = new Intent(TrackerActivity.this, MakacMapa.class); intent2.putParcelableArrayListExtra("Zaznam",zaznam); Second activity Intent intent = new Intent(); ArrayList<LatLng> zaznam = intent.getParcelableArrayListExtra("Zaznam"); //and here

Passing dataset between activity in MPAndroidChart

女生的网名这么多〃 提交于 2019-12-12 06:49:51
问题 I want to display barchart in full screen after clicking on a button but I got an error when passing BarEntry class between activities. android.os.ParcelFormatException: Cannot parcel an Entry with non-parcelable data my code : ArrayList<BarEntry> barEntries = new ArrayList<>(); barEntries.clear(); barEntries.add(new BarEntry(0, new float[]{8f, 9f, 10f}, "Jan")); barEntries.add(new BarEntry(1, new float[]{11f, 9f, 5f}, "Feb")); barEntries.add(new BarEntry(2, new float[]{8f, 3f, 4f}, "Mar"));

Unmarshalling unknown type code 6881391 at offset 4752 After Upgrading to Support Libraries 23.2.0

。_饼干妹妹 提交于 2019-12-12 02:49:33
问题 My app has been working well at Support Libraries 23.1.1. However, after upgrading to Support Libraries 23.2.0, it starts to crash. The crash happens when I navigate from an activity back to the main activity (for example, I open the about activity from main activity's actionbar menu, then press back button to go back to main activity, then it crashes). The crash log is here: FATAL EXCEPTION: main Process: com.myapp.blah.blah, PID: 22124 java.lang.RuntimeException: Unable to start activity

Retrieve the value of a parcelable objet from the second activity to mainActivity that invoke the second

会有一股神秘感。 提交于 2019-12-12 02:46:39
问题 I have a class that implements the Parcelable class. From main activity, I pass an parcelable object. At the second activity I retrieve the objet and use the objet to change data. All is ok. But the problem is when I need to retrieve this changes from second activity to the main activity. I don't know how could I do it. Here the call in the main activity: public class MainActivity extends Activity { Tgestion Tges= new Tgestion(); Button buttonI,buttonM,buttonB,buttonD,buttonS; @Override

Trying to retrieve data from parcel

岁酱吖の 提交于 2019-12-12 01:19:35
问题 I have an Order Object that contains an ArrayList of MenuItem Objects. Both classes implement the Parcelable interface. When I attempt to retrieve the object from the Intent in the new activity I get the following error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.waitron5/com.example.waitron5.SectionsActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.example.waitron5.MenuItem Here is the code where I send the Order