parcelable

Replace gallery image with gallery image in android show too large exception

心已入冬 提交于 2021-02-17 06:01:16
问题 java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 51924760 bytes when one image is select from gallery is work but when i am try to update same image with new image from gallery in android it show this error and application crash Solution for this problem is given below // when you pass bitmap through listview adapter to get this in Fragment imageBitMap = getArguments().getParcelable("bitmapImage"); profileImageView.setImageBitmap(imageBitMap); //Add this

Passing Parcelable object which has a member variable which is Not parcelable(a class that belongs to third party library)

好久不见. 提交于 2021-02-11 14:13:51
问题 I'm trying to send a class's object(let's say Class X's object) as part of class that implements Parcelable. The problem that I am facing here is, Class X is a part of some library and I can not edit it to implement Parcelable or serializable. I've checked that Class X does not implement Parcelable or serializable and we can not change as well. Can you guys please help me here? MainActivity: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle

Parcelable object passing from android activity to fragment

帅比萌擦擦* 提交于 2021-02-08 11:24:45
问题 I'm trying to pass an object that implements Parcelable from an activity to a fragment. I know how to pass from activity to activity. I just want to try this. But when I received the object it always received null . How can I resolve this problem? currentObject is the object instance of the class which implements Parcelable ContentMainFragment is the Fragment class In the activity Fragment fragment = new ContentMainFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("SampleObject",

Parcelable object passing from android activity to fragment

。_饼干妹妹 提交于 2021-02-08 11:24:21
问题 I'm trying to pass an object that implements Parcelable from an activity to a fragment. I know how to pass from activity to activity. I just want to try this. But when I received the object it always received null . How can I resolve this problem? currentObject is the object instance of the class which implements Parcelable ContentMainFragment is the Fragment class In the activity Fragment fragment = new ContentMainFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("SampleObject",

Pass array in Intent using parcelable

a 夏天 提交于 2021-02-08 10:16:34
问题 I would like to send an array of objects between activities. I want to use the parcelable interface and send the data in an intent. However I keep getting errors. I have been stuck for 2 days. Here are some details about my problem. Class A private ProjetUI[] mProjects; private final View.OnClickListener mOnClickListener = new View.OnClickListener() { @Override public void onClick(View view) { Context context = view.getContext(); Intent intent = new Intent(context, ProjetListActivity.class);

Pass array in Intent using parcelable

只愿长相守 提交于 2021-02-08 10:15:22
问题 I would like to send an array of objects between activities. I want to use the parcelable interface and send the data in an intent. However I keep getting errors. I have been stuck for 2 days. Here are some details about my problem. Class A private ProjetUI[] mProjects; private final View.OnClickListener mOnClickListener = new View.OnClickListener() { @Override public void onClick(View view) { Context context = view.getContext(); Intent intent = new Intent(context, ProjetListActivity.class);

How to use Parcelable in AIDL

*爱你&永不变心* 提交于 2021-02-07 10:29:17
问题 I define a class which implements Parcelable , like this: public class Book implements Parcelable And I know I can use this class in AIDL file like this: import com.okay.demo.aidl.bean.Book; interface IBookManager { void addBook(in Book book); } But what I want to know is that can I just Parcelable in AIDL file suppose I don't know the implementation class? Can I just use Parcelable like this : interface IBookManager { void addData(in Parcelable data); } I had tried replace Book with

How to use Parcelable in AIDL

元气小坏坏 提交于 2021-02-07 10:27:02
问题 I define a class which implements Parcelable , like this: public class Book implements Parcelable And I know I can use this class in AIDL file like this: import com.okay.demo.aidl.bean.Book; interface IBookManager { void addBook(in Book book); } But what I want to know is that can I just Parcelable in AIDL file suppose I don't know the implementation class? Can I just use Parcelable like this : interface IBookManager { void addData(in Parcelable data); } I had tried replace Book with

android.os.Parcelable[] cannot be cast to… Error

可紊 提交于 2021-02-07 09:47:57
问题 I'm doing a project for my class and I'm having an issue with it. I get the following error when I add a book There is a parcelable authors class that will be an array and a parcelable books class. The authors get stored in the book parcelable : Error: java.lang.RuntimeException: Failure delivering result ResultInfo {who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {edu.stevens.cs522.bookstore/edu.stevens.cs522.bookstore.activities.BookStoreActivity}: java.lang

Android: Sending an object from one activity to other activity

我的梦境 提交于 2021-01-27 19:21:44
问题 To send intent with any object from one activity to another activity we can use Parcelable Interface or Serializable Interface. What is the difference between two? Which one is preferable to use? Moreover, we can send string, integer type of object without using all this Interface. How it is possible? 回答1: Java Serializable: Serializable comes from standard Java and is much easier to implement all you need to do is implement the Serializable interface and add override two methods. private