This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
Type type = getCollectionType(ImmutableList.class, Number.class); | |
Gson gson = new GsonBuilder().registerTypeAdapter(type, new ImmutableList_TypeAdapter<Number>()).create(); | |
ImmutableList<Number> list = gson.fromJson("[1,2,3]", type); | |
ListVO vo = gson.fromJson("{\"numbers\":[1,2,3]}", ListVO.class); | |
} | |
private static class ListVO { | |
@Expose @SerializedName("numbers") | |
ImmutableList<Number> numbers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; | |
import android.widget.TextView; | |
/** | |
* Created by khaled bakhtiari on 10/26/2014. | |
* <a href="http://about.me/kh.bakhtiari"> | |
*/ |