android-recyclerview

Open different activities by clicking on different cards in CardView ,Recyclerview Fragment in Android studio

人走茶凉 提交于 2020-08-10 22:52:57
问题 I have created a RecyclerView and added cards in fragment.I want to open different activities by clicking on different cards in CardView.But I am only able to open the same activity for all the cards.I searched different answers in StackOverFlow.But I couldn't. could you tell me how to solve this issue...? If you can give full code,I'm happy. Here are my codes... PDFFragment.java public class PDFFragment extends Fragment { View v; List<Pdf> listBook; public View onCreateView(@NonNull

How to pass data from a activity to a recycler view adapter in android

牧云@^-^@ 提交于 2020-08-10 21:16:11
问题 I'm trying to design a page where address are stored in recycler view -> cardview. When the user clicks the add address button from the Activity A the user is navigated to the add address page in Activity B . Here the user can input customer name, address line 1 and address line two. And once save button is clicked in Activity B , a cardview should be created under the add address button in the Activity A . This design is just like the amazon mobile app add address option. Could anyone give

Showing xml for correct view

我的未来我决定 提交于 2020-08-10 19:15:07
问题 When a user logs in to my app, they can either click the view students button or daily grading button. The view students will display a student's image and their name. The daily grading will display the student's image, name, and two checkboxes that says pass or fail. Now the issue I have is that the checkboxes for pass and fail are showing up in my activity_view_students.xml view when it should not be. It should only show when a user clicks daily grading . I will put images below to make it

RecyclerView not updating after calling changeCursor

我怕爱的太早我们不能终老 提交于 2020-08-10 13:12:10
问题 Background: I have an orders table in my database whose data I show in RecyclerView . I do it by using a CursorAdapter in RecyclerView.Adapter . All of this is done in parent activity. Besides this I have a child activity which is responsible for adding new orders to orders table and then coming back to parent activity to show all the orders in RecyclerView including the newly ones just created. New orders are added by starting a child activity in addOrder() . Problem: When I come back from

RecycleView TouchListener while autoScroll

亡梦爱人 提交于 2020-08-09 21:24:06
问题 I try to make RecyclerView with AutoScroll function. Now it working fine. But I want to TouchEvent with AutoScroll. It means if user didn't touch, list is auto scrolled. And if user touch, list move to follow user's finger. But now if user touch list, list stoped, but after 1 second it move again even still finger is touched. Here is my code. recyclerView.addOnItemTouchListener(new RecyclerView.SimpleOnItemTouchListener() { @Override public boolean onInterceptTouchEvent(RecyclerView rv,

Cardview ripple effect doesn't work

安稳与你 提交于 2020-08-07 03:49:41
问题 Min SDK is 21. When I click on a cardview in my recycler adapter, the ripple effect doesn't happen and just goes to the next screen. The recyclerview is inside a fragment. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.v7.widget.CardView android:id="@+id

Cardview ripple effect doesn't work

无人久伴 提交于 2020-08-07 03:49:31
问题 Min SDK is 21. When I click on a cardview in my recycler adapter, the ripple effect doesn't happen and just goes to the next screen. The recyclerview is inside a fragment. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.v7.widget.CardView android:id="@+id

E/RecyclerView: No adapter attached; skipping layout (Using FRAGMENTS)

旧城冷巷雨未停 提交于 2020-08-03 09:14:08
问题 I modified my code according to the answers I found to similar questions but none of them worked. I am using TabFragments and RecyclerViews. The console displays the error "E/RecyclerView: No adapter attached; skipping layout" four times. (When modifying it also gave me the error "java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference",

How to scroll recyclerView programmatically?

≡放荡痞女 提交于 2020-08-01 10:44:01
问题 I have a horizontal recyclerView, When I first open the activity I want to make all the items in recyclerview scroll to the bottom (to the right in this case) and back to the top (to the left). Kinda like an animation. Scroll behavior should be visible to the user. I tried to do it like: Animation slideRight = AnimationUtils.loadAnimation(this, R.anim.slide_right); Animation slideLeft = AnimationUtils.loadAnimation(this, R.anim.slide_left); slideRight.setDuration(1000); slideLeft.setDuration

How to scroll recyclerView programmatically?

一曲冷凌霜 提交于 2020-08-01 10:41:05
问题 I have a horizontal recyclerView, When I first open the activity I want to make all the items in recyclerview scroll to the bottom (to the right in this case) and back to the top (to the left). Kinda like an animation. Scroll behavior should be visible to the user. I tried to do it like: Animation slideRight = AnimationUtils.loadAnimation(this, R.anim.slide_right); Animation slideLeft = AnimationUtils.loadAnimation(this, R.anim.slide_left); slideRight.setDuration(1000); slideLeft.setDuration