title: How to use shared Preferences in static method
body: <p>here this is my static method</p>
  
  <pre><code>public static void messageHandler(final MessageMO messageMo) {
  
          UIHandler = new Handler(Looper.getMainLooper());
  
          UIHandler.post(new Runnable() {
              public void run() {
                  //  SharedPreferences sharedPreferences1;
                  Log.e("messageHandler", messageMo.getEventTitle());
                  ChatMO chatMO = new ChatMO();
                  chatMO.setMessage(messageMo.getMessage());
                  chatMO.setSelf(0);
                  chatMO.setFromName(messageMo.getfromUserName());
                  chatMO.setDate(messageMo.getDate());
                  chatMO.setEvent_id(messageMo.getEventId());
                  Log.e("handler", "eventid" + chatMO.getEvent_id());
                  Log.e("handler", "date" + chatMO.getDate());
                  listChatMessageObjectses.add(chatMO);
                  Log.e("handler", "listmessage" + listChatMessageObjectses);
  
                      }
          });
      }
  </code></pre>
  
  <p>here i have to store the value of listChatMessageObjects into shared preferences how to do it thanks in advance </p>