android-recyclerview

Android update recyclerView items

╄→尐↘猪︶ㄣ 提交于 2019-12-25 12:50:49
问题 i have simple problem on update recyclerview items by new data, i'm wondering which code work fine without using data binding, in my code adding new items trigger by click on button as clickOnSendCommandToRobot method, this method must add new item into List and my adapter can be know that to add new data and refresh RecyclerView , i dont get any error, but list size is 1 always public class ActivityRegister extends BaseActivities { private RobotMessagesAdapter adapter; private List

Add item to RecyclerView when a Button is clicked

不想你离开。 提交于 2019-12-25 11:56:10
问题 I want to add items to RecyclerView when I click the "Add" button This currently works but only once , meaning if I click the Add button the first time, the item is added and visible, but after that, nothing is added. Here is my code for RecyclerView Adapter public class Adapter extends RecyclerView.Adapter<Adapter.myViewHolder> { List<Integer> listItem; public Adapter(List<Integer> passedListItem){ this.listItem = passedListItem; } @Override public myViewHolder onCreateViewHolder(ViewGroup

Add item to RecyclerView when a Button is clicked

元气小坏坏 提交于 2019-12-25 11:56:07
问题 I want to add items to RecyclerView when I click the "Add" button This currently works but only once , meaning if I click the Add button the first time, the item is added and visible, but after that, nothing is added. Here is my code for RecyclerView Adapter public class Adapter extends RecyclerView.Adapter<Adapter.myViewHolder> { List<Integer> listItem; public Adapter(List<Integer> passedListItem){ this.listItem = passedListItem; } @Override public myViewHolder onCreateViewHolder(ViewGroup

RecyclerView not appearing

你。 提交于 2019-12-25 09:50:57
问题 Hi I just set up this RecyclerView and can't find what's wrong. Thanks in advance. I'm sure the RecyclerView is showing up though their is a faint shade on the main activity screen where I can pull down and pull up. I think the problem may revolve around this part of my line activity: getSupportActionBar().setTitle(null); recyclerView = (RecyclerView) findViewById(R.id.line_list); adapter=new MyAdapter(getApplicationContext(),getData()); recyclerView.setAdapter(adapter); recyclerView

RecyclerView not appearing

女生的网名这么多〃 提交于 2019-12-25 09:48:28
问题 Hi I just set up this RecyclerView and can't find what's wrong. Thanks in advance. I'm sure the RecyclerView is showing up though their is a faint shade on the main activity screen where I can pull down and pull up. I think the problem may revolve around this part of my line activity: getSupportActionBar().setTitle(null); recyclerView = (RecyclerView) findViewById(R.id.line_list); adapter=new MyAdapter(getApplicationContext(),getData()); recyclerView.setAdapter(adapter); recyclerView

Recyclerview Inconsistency detected. Invalid view holder adapter positionViewHolder

风格不统一 提交于 2019-12-25 09:40:11
问题 In my app right now I am working with two lists. One is a List of an Object and the other the a List of Lists of the same object. I have a method in my Activity that transforms a list of Object into a List of Lists of object. And to my adapter I am passing the list of lists through this call: mAdapter.swap(transformList(pipe.mList)); The method swap is responsible for passing the transformed list to my Adapter: public void swap(List<List<Feed>> feedList) { if (finallist == null) { finallist =

RecyclerView and gridView

北战南征 提交于 2019-12-25 08:57:17
问题 I implemented gridview using recyclerview the problem is that images are not showing properly like there is so much space between images, here is xml of mainactivity and griditem.xml mainactivity.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar android:id="@

Set an ImageView in a ViewHolder getting Uri List from another activity

老子叫甜甜 提交于 2019-12-25 08:46:18
问题 Okay the problem is that I am selecting multiple images and have to display all the selected images in another activity recycler view(Grid View). I got the Uri paths(Tried string as well) in the first activity. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { try { // When an Image is picked if (requestCode == SELECT_PICTURE_MULTIPLE && resultCode == RESULT_OK && null != data) { // Get the Image from data String[] filePathColumn = { MediaStore.Images

Getting 'Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference' even when the reference is not null

ⅰ亾dé卋堺 提交于 2019-12-25 08:28:51
问题 I'm using FirebaseUI in my app and FirebaseRecyclerAdapter to be more specific. I'm fetching data from my FirebaseDatabase reference using the method given here. Here's my code: private void attachRecyclerViewAdapter() { Query lastFifty = mDatabase.child(rID).limitToFirst(50); mRecyclerViewAdapter = new FirebaseRecyclerAdapter<AModelClass, AModelClass.ViewHolder>( AModelClass.class, R.layout.a_player_layout, APlayersModelClass.ViewHolder.class, lastFifty) { @Override protected void

Popup window in RecyclerView Adapter

只愿长相守 提交于 2019-12-25 07:59:30
问题 I am newbie at android, I am trying show popup window when RecyclerView item clicked but a little bit confused, I looked this question but cant figure out this Context issue public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> { private ArrayList<Mission> mDataset; public MyAdapter(ArrayList<Mission> myDataset) { mDataset = myDataset; } // Create new views (invoked by the layout manager) @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {