Unable to save ArrayList value in Shared Preference in Andorid

Can any one help me whats wrong in my code unable to save ArrayList document value in shared Preference getting null value in Debug of Array List Document

please help me

Thanks in advance

here is my JSON response

{    "errCode": 0,    "message": "Success",    "responseDestinationDocument": [        {            "name": "United Arab Emirates",            "document": [                {                    "name": "Passport Front",                    "id": "2",                    "notes": [                        {                            "name": "Upload colored passport copies."                        },                        {                            "name": "Passport should be valid 6 months from the date of entry in Sri Lanka."                        },                        {                            "name": "DDDDDDD"                        }                    ]                },                {                    "name": "Passport Back",                    "id": "3",                    "notes": [                        {                            "name": "Upload colored passport copy."                        }                    ]                },                {                    "name": "Photograph",                    "id": "4",                    "notes": [                        {                            "name": "Upload photograph with white background"                        }                    ]                }            ]        }    ] } 

I want to save ArrayList document value in shared Preference

Here is activity code

public void documentRequiredCall() {          Call<DocumentFetchModel> call = RetrofitClient                 .getInstance().getApi().documentFetchModel(booking_id, count_index);          showProgressDialog();         call.enqueue(new Callback<DocumentFetchModel>() {              @Override             public void onResponse(Call<DocumentFetchModel> call, retrofit2.Response<DocumentFetchModel> response) {                 final DocumentFetchModel documentFetchModel = response.body();                 hideProgressDialog();                   PrefUtils.setDocId(documentFetchModel.getResponseBookingDocument().get(0).getDocument(), UploadDocumentsActivity.this);                   if (documentFetchModel.getErrCode().booleanValue() == true) {                      responseBookingDocumentArrayList = new ArrayList<ResponseBookingDocument>();                       try {                          Log.e("Booking_Document", new Gson().toJson(response.body()));                        } catch (Exception e) {                         e.printStackTrace();                     }                   } else {                      Toast.makeText(UploadDocumentsActivity.this, documentFetchModel.getMessage() + "", Toast.LENGTH_SHORT).show();                 }             }              @Override             public void onFailure(Call<DocumentFetchModel> call, Throwable t) {                  hideProgressDialog();                 Toast.makeText(UploadDocumentsActivity.this, t.getMessage() + "", Toast.LENGTH_LONG).show();                 Log.e("Error", t.getMessage() + "");             }         });       } 

Here is PrefUtils Class

public class PrefUtils {   public static DocumentFetchModel getDoc(Context ctx) {         ComplexPreferences complexPreferences = ComplexPreferences.getComplexPreferences(ctx, "get_doc", 0);         DocumentFetchModel currentUser = complexPreferences.getObject("docs", DocumentFetchModel.class);         return currentUser;     }      public static void setDoc(DocumentFetchModel currentUser, Context ctx) {         ComplexPreferences complexPreferences = ComplexPreferences.getComplexPreferences(ctx, "get_doc", 0);         complexPreferences.putObject("docs", currentUser);         complexPreferences.commit();     }      } 

Can I repurchase apps so they can be shared with my family library?

The documentation states:

Any apps or games purchased after July 2, 2016 are eligible to be added to Family Library. If you purchased the app or game before July 2, 2016, it’s eligible for Family Library if the developer has made past purchases available. You can find out whether this is the case by tapping Read More on the app’s details page.


I have apps that I purchased before this cut off date that I would like to share via my Family Library. Unfortunately when I visit the Play Store page for these apps I am offered either an Install or Uninstall button instead of the Buy button.

This leads me to ask:

  • Am I able to repurchase these apps with my primary google account so that I can share them via the Family Library?

  • If I purchase them with a Family Linked child account will they be shared with the other members of our Family?

Shared tenant different header

AS-IS: There is a group of companies, every company (exclude one) have the same brand (same colors, names, …), but this one company (our) have different brand (e.g. wecare, with different colors, …) and the problem is that we share one tenant on o365 (we can´t make our own tenant). As we are part of the same tenant, the visual is the same for every company. For our sites we use prefix (wecare) and join sites to one hub.

TO-BE We need to change our header to be different from the other companies, and stay on that tenat.

(names of companies are fancifully) Visualization on picture example

Is there any way we do this (without some big hacking)? Maybe with some spfx webpart or extension?

Thank you for your help 🙂

Jenkins – shared library and class loading

We are using the shared library Jenkins plugin for our Jenkins code, namely workflow-cps-global-lib.

We implemented workflows successfully on different project types with groovy code in one single shared library.

Today we are encountering an issue which seem class-loading related and I m not sure where the problem lies.

Using an instance of “JAXBContext” in our shared library leads to a classcastexception. I will update later with the exact exception.

The class gets loaded from some other plugin installed on our jenkins.

At some point it was loaded from deployit-plugin (jenkins/plugins/deployit-plugin/web-inf/lib/jaxb-impl-xxx.jar).

After installing xlrelease-plugin (xlrelease-plugin/web-inf/lib/jaxb-impl-xxx.jar), it seems that JAXBContext is now loaded from this plugin and we don’t get “ClassCastException” anymore.

There is no direct dependency between the shared library plug-in and those. Our code call methods exposed by those plug-ins tho. My guess for now is that somehow, because we call those plug-ins in our code, we inherit their class path.

If that’s the case then how can we have control over which jar version is called? WE tried using grape to grab our version of the jaxb implementation and api but still, the jaxbcontext that was loaded was still the one from xlrelease-plugin.

I looked a bit at the code of workflow-cps-global-lib on github. As expected there’s some class loader manipulation.

But I didn’t find any pointer to the relations with the class loaders of other plugins.

If I understood correctly what’s stated in the Jenkins documentation, when plugin A depends on plugin B, plugin class loader inherits jars from plugin B.


“workflow-cps-global-lib” does not depend on xlrelease-plugin or deployit-plugin thus should not inherit their class paths.

If anyone has insight as to why I get those classes loaded it in my pipeline exécution it would be very helpful.

Force download of Word Document external shared link

I am working with a member of HR that is attempting to share a Word Document file with applicants.

I have genereated them a externally shareable link and it works great for opening in Word Online. However, these applicants need to be able to edit their own copy of this document and return it via email.

I found this article that explains how to do it in my-sharepoint, by I need to do it for actual SharePoint Online.

How can I share a document externally and force a download of the file rather than it attempting to open in Word Online?

Is it okay to use shared preferences for big data objects?

I know there are some topics and posts about this question, but i want to have an individual feedback. So in my app i use one shared preferences (file) and gson to store a list of objects, containing big amount of data. So my shared preference file is about 5 MB big and contains ca 1 Mio characters. I know this sounds not really good, but my app works perfectly. No long loading or saving times.

I choose this method, because i ONLY want to store the data, when my app will be closed and between app starts.

I know really good, that shared prefs is not a good way and actually meant for saving small strings for preferences. So do i have to change this method or is it “okay”? Or does someone know a good solution, which is easy to use and understand, because for me sqlite is difficult and hard to use. Or is there a easy way to store an object into sql? (Maybe a library or a method??)

Thank you in advanced!

How can I configure apparmor to allow mariadb load a shared library?

After a routine update yesterday, MariaDB would not start because a shared library file is not loading because it is being blocked by apparmor.

Here’s the output from the journalctl -xe

Apr 17 11:44:45 pbts-academic audit[10349]: AVC apparmor="DENIED" operation="file_mmap" profile="/usr/sbin/mysqld" name="/usr/lib/x86_64-linux-gnu/liblz4.so.1.7.1" Apr 17 11:44:45 pbts-academic kernel: audit: type=1400 audit(1555472685.956:79): apparmor="DENIED" operation="file_mmap" profile="/usr/sbin/mysqld" name="/usr/lib/x86_64-linux-gnu/liblz4.so.1.7.1" Apr 17 11:44:45 pbts-academic mysqld[10349]: /usr/sbin/mysqld: error while loading shared libraries: liblz4.so.1: failed to map segment from shared object Apr 17 11:44:45 pbts-academic systemd[1]: mariadb.service: Main process exited, code=exited, status=127/n/a Apr 17 11:44:45 pbts-academic systemd[1]: mariadb.service: Failed with result 'exit-code'. Apr 17 11:44:45 pbts-academic systemd[1]: Failed to start MariaDB 10.3.14 database server. -- Subject: Unit mariadb.service has failed -- Defined-By: systemd -- Support: http://www.ubuntu.com/support --  -- Unit mariadb.service has failed. --  -- The result is RESULT. 

Thanks in advance.

How do you manage objects that are shared between back-end services and front-end services/apps?

I have multiple REST-ful APIs that I’m using as my “back-end”. I also have multiple web apps (.NET MVC). These web apps make calls to the APIs for data. So, an object being returned by an API will be the same as the object being expected on the web app side (serialized from JSON of course).

For example, if my web app makes a call to an API for a Customer object, that same object will be used across both the API and web app projects.

So, the question is, how do you manage this scenario (create NuGet packages for shared objects/interfaces, duplicate code, etc.)?

Any feedback is greatly appreciated. Thanks!