Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] android – How to prevent TransactionTooLarge exception while passing data between JobIntentService to activity via Broadcast receiver

Posted on November 14, 2022

Solution 1 :

You cannot pass “large amount of data” in an Intent. If you have a “large amount of data” to pass then you need to use one of the following:

  • Store the data in SQLite database
  • Store the data in a file
  • Store the data in a public static variable so that it can be accessed by all classes in your application (isn’t the best alternative, as there are issues around app restarts, but it is the simplest method)

Problem :

After login Page, I am downloading data from server using JobIntentService and passing the data to activity via BroadcastReceiver.
For smaller amount of data it works fine but when I am working on live data it is giving below exception:

Caused by: android.os.TransactionTooLargeException: data parcel size 1450704 bytes
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:1127)
        at android.app.IActivityManager$Stub$Proxy.broadcastIntent(IActivityManager.java:3893)
        at android.app.ContextImpl.sendBroadcast(ContextImpl.java:1009)
        at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:444) 

I passing data like this from service class : 
Intent intent = new Intent(ACTION_CHECK_DOWNLOADSTATUS);
intent.putExtra("response",response);
sendBroadcast(intent);


But it gives TransactionTooLargeException..
How to prevent this?

How do I pass large amount of Data ??

Pls suggest...
READ  [ANSWERED] java - Android Studio - How do I make my RecyclerView contain more items after a button press?
Powered by Inline Related Posts

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress