Java tutorial
//package com.java2s; import android.util.Log; import com.google.gson.Gson; public class Main { public static Object parse(String msg, Class tClass) { try { Log.i("Class", msg); Gson gson = new Gson(); Object obj = gson.fromJson(msg, tClass); return obj; } catch (Exception e) { } return null; } }