RecyclerView onclick

RecyclerView step 3 step1 public class xxxxxxxx extends RecyclerView.Adapter<MyAdapter.ViewHolder> implements View.OnClickListener { step2 public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position viewHolder.textView.setOnClickListener(this); textView is findViewById(R.id.xxxxxxxxx) step3 @Override public void onClick(View view) { int viewId = view.getId(); if (viewId == R.id.xxxxxxxxx) { //which item click if (onItemClickListener != null) { onItemClickListener.onItemClick(view, (Integer) view.getTag()); } } } view.getTag() maybe null

繼續閱讀

https://developer.android.com/training/material/lists-cards.html I think many people, try to do this demo. But this demo is not good, because some things no show. like: RecyclerView .xml to a layout:…….only little, but ok, this not import. MyAdapter .xml no layout: this is bad. Get error in here. so, follow this do is better http://stackoverflow.com/questions/28407768/android-widget-linearlayout-cannot-be-cast-to-android-widget-textview-in-recycle Gorcyn is good guy~~ ^ ^ But what different with android demo (fxxxxxxxxxxxxxx) android: public ViewHolder(TextView v) { mTextView = v; good guy:

繼續閱讀

http://xxx.xxx.xxx.xx:4985/admin/ click Documents click left documents, then show data on top. then can see two button “Save Doc” “Revert DOC” Now you can change data in { …………….. } Changed finish, click “Save Doc”, now document be change. I think sync to app right now.

繼續閱讀

作者的圖片

Sue boy

Sueboy Can support You

CIO

Taiwan