android-recyclerview

Error on Recycler view on fragment

喜你入骨 提交于 2020-07-11 05:03:10
问题 I am using Recyclerview on a fragment when i run the app and open the activity it crashes.I am new to android so i am not able to implement Recyclerview with SQlite as i followed some code on internet and implemented in my code but my app crashes log 02-25 11:53:20.362 19942-19942/com.navinkadlak.typroject E/AndroidRuntime: FATAL EXCEPTION: main Process: com.navinkadlak.typroject, PID: 19942 java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v7

Error on Recycler view on fragment

本秂侑毒 提交于 2020-07-11 05:01:18
问题 I am using Recyclerview on a fragment when i run the app and open the activity it crashes.I am new to android so i am not able to implement Recyclerview with SQlite as i followed some code on internet and implemented in my code but my app crashes log 02-25 11:53:20.362 19942-19942/com.navinkadlak.typroject E/AndroidRuntime: FATAL EXCEPTION: main Process: com.navinkadlak.typroject, PID: 19942 java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v7

Retrieving data using FirebaseRecyclerOptions [duplicate]

岁酱吖の 提交于 2020-07-10 09:57:24
问题 This question already has answers here : FirebaseListAdapter not pushing individual items for chat app - Firebase-Ui 3.1 (2 answers) Closed last year . I need help in retrieving data using firebase recycleview adapter. I have tried many ways but I am unable to retrieve data. My main class fragment goes thus. public class AllUsers extends AppCompatActivity { RecyclerView recyclerView; Query databaseReference; FirebaseRecyclerOptions<Users> options; FirebaseRecyclerAdapter<Users,

Kotlin: Show AlertDialog when RecycleView item clicked

元气小坏坏 提交于 2020-07-10 08:17:25
问题 Now I'm studying to show AlertDialog when RecyclerView item clicked. However, I don't know how to set the adapter for click listener. Could you give me a tip? Firstly, I tried to put the AlertDialog in this Main Activity. Is this right position? MainActivity class MainActivity : AppCompatActivity() { private val foodList = listOf( FoodModel("Noodle", 2), FoodModel("Cake", 3), FoodModel("Pizza", 4), FoodModel("Stake", 5), FoodModel("Chicken", 4) ) override fun onCreate(savedInstanceState:

How to convert Firebase Old Adapter method to New Adapter method?

妖精的绣舞 提交于 2020-07-10 07:30:31
问题 In the main Screen of my app I was trying to build a Search View with Edit Text. I have made a recycler view below the search view. My app is a music app. So I want to build a function like when user search any song from firebase then the song name and song artist should be displayed in the recycler view. So i have read a code for do this particular work. But I am facing a problem like In my code there was a FirebaseRecyclerAdapter method which was used to get values from firebase from my

How to convert Firebase Old Adapter method to New Adapter method?

不打扰是莪最后的温柔 提交于 2020-07-10 07:30:08
问题 In the main Screen of my app I was trying to build a Search View with Edit Text. I have made a recycler view below the search view. My app is a music app. So I want to build a function like when user search any song from firebase then the song name and song artist should be displayed in the recycler view. So i have read a code for do this particular work. But I am facing a problem like In my code there was a FirebaseRecyclerAdapter method which was used to get values from firebase from my

Snackbar from custom class not showing

拈花ヽ惹草 提交于 2020-07-10 06:45:00
问题 MyActivity coord.xml: <CoordinatorLayout> id:coordID <RelativeL> ... <FAB> RVAdapter.java ... @Override public void onItemDismiss(int position) { ... notifyItemRemoved(position); LayoutInflater inflater = (LayoutInflater) MyActivity.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(R.layout.coord, null); Snackbar.make(v.findViewById(R.id.coordID), "TEXT", Snackbar.LENGTH_LONG).show(); } This is a method for swiping to delete an item from recycler view

Snackbar from custom class not showing

▼魔方 西西 提交于 2020-07-10 06:43:47
问题 MyActivity coord.xml: <CoordinatorLayout> id:coordID <RelativeL> ... <FAB> RVAdapter.java ... @Override public void onItemDismiss(int position) { ... notifyItemRemoved(position); LayoutInflater inflater = (LayoutInflater) MyActivity.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(R.layout.coord, null); Snackbar.make(v.findViewById(R.id.coordID), "TEXT", Snackbar.LENGTH_LONG).show(); } This is a method for swiping to delete an item from recycler view

RecyclerView Espresso Testing Fails Due to RunTimeException

删除回忆录丶 提交于 2020-07-10 06:43:23
问题 I have the following code I am using, trying to set up Espresso: import android.support.test.espresso.Espresso; import android.support.test.espresso.contrib.RecyclerViewActions; import android.support.test.espresso.matcher.ViewMatchers; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import static android.support.test.espresso.action.ViewActions.click; @RunWith

Snackbar from custom class not showing

十年热恋 提交于 2020-07-10 06:43:12
问题 MyActivity coord.xml: <CoordinatorLayout> id:coordID <RelativeL> ... <FAB> RVAdapter.java ... @Override public void onItemDismiss(int position) { ... notifyItemRemoved(position); LayoutInflater inflater = (LayoutInflater) MyActivity.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(R.layout.coord, null); Snackbar.make(v.findViewById(R.id.coordID), "TEXT", Snackbar.LENGTH_LONG).show(); } This is a method for swiping to delete an item from recycler view