android-recyclerview

how to use intents in recyclerview items of navigation drawer to open a new activity fragment?

寵の児 提交于 2019-12-25 01:46:30
问题 My activity class is like following: /*ToolBar SetUp*/ app_toolBar = (Toolbar) findViewById(R.id.toolbar_header); setSupportActionBar(app_toolBar); getSupportActionBar().setDisplayShowTitleEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); String TITLES[] = {"Home", "Search", "HalalRewards", "Contact Us", "User Guide", "F.A.Q", "Settings", "Share"}; int ICONS[] = {R.drawable.ic_action_home, R.drawable.ic_search, R.drawable

“No adapter attached; skipping layout” on a fragment

痴心易碎 提交于 2019-12-25 01:23:15
问题 public class WorkFragment extends Fragment { List<CardViewItem> items = new ArrayList<>(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d("FRAGMENT", "Work Fragment started"); TypedArray icons = getResources().obtainTypedArray(R.array.project_icons); TypedArray names = getResources().obtainTypedArray(R.array.project_names); TypedArray descs = getResources().obtainTypedArray(R.array.project_descs); for (int i=0;i<icons.length();i++){ items

How to add image from SQL Database into RecyclerView

佐手、 提交于 2019-12-25 01:08:27
问题 I want to display a Recipe photo from my SQL Database into my RecyclerView. I declared as String the photo variable in my Recipe class: public class Recipe { private String title; private String photo; private String instructions; private int targetPeople; private int time; public Recipe(String title, String photo, String instructions, int targetPeople, int time) { this.title = title; this.photo = photo; this.instructions = instructions; this.targetPeople = targetPeople; this.time = time; }

Create single adapter for any type of List Android

元气小坏坏 提交于 2019-12-25 01:01:26
问题 I am trying to create Generic Adapter in Android. I am succeeded in creating to the given level where I have to extend RecyclerBaseAdapter import kotlinx.android.synthetic.main.activity_animal_list.* class SubjectListActivity : AppCompatActivity() { var subjects = mutableListOf<SubjectBO>() val database = FirebaseDatabase.getInstance() lateinit var subjectAdapter: SubjectAdapter override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout

Recycle View doesn't show data from adapter [duplicate]

℡╲_俬逩灬. 提交于 2019-12-25 00:59:11
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 6 months ago . Currently I'm using RecyclerView from Android to show some data that I get from Firebase. I'm using MVC design pattern so I had to pass some data from the view ( actViewDB ), to the controller( Controller ) and then to the Model class ( DataModel ). Unfortunately I always get the Java NullPointerException error like this E/AndroidRuntime: FATAL EXCEPTION: main

RecyclerView Adapter onBind method

 ̄綄美尐妖づ 提交于 2019-12-25 00:53:22
问题 I have in my MainActivity 3 RecyclerViews . One of them in a bottom sheet and it is the main one (By Default the Bottom sheet is Open To Display this one ), in its adapter's onbind method I made an onClickListener so that I want when the user clicks on an item in it, I want to go back to the main activity class to set To Start a method which it's rolled is to close the Bottom Sheet and set the data for the next recycling view (which will appear when the Bottom Sheet is closed) ..... The issue

seachview not filtering in recyclerview

笑着哭i 提交于 2019-12-25 00:14:32
问题 I am developing news app and I have implemented search view in recyclerview in fragment on navigation drawer but it is not filtering any news. I have followed following stackoverflow post Implement Searchview with Navigation Drawer and Fragment inside I am calling two ending point first top headlines below root client class @Module public class SportClient { private static final String ROOT_URL = "https://newsapi.org"; /** * Get Retrofit Instance */ private static Retrofit getRetrofitInstance

Saving selected RadioButton's text in model class from recyclerview item

隐身守侯 提交于 2019-12-25 00:13:05
问题 From RecyclerView item, I am trying to save the selected RadioButton's text in model class. When I select a RadioButton from 1st item, it's text is saved appropriately. Problem is, RadioButton's text at the same position from 8th item is also auto saved. If I select radio button from 2nd item, text from 9th item is also auto saved, and so on. How to solve this problem? onBindViewHolder method is given below : @Override public void onBindViewHolder(@NonNull final ViewHolder holder, final int

AdView and search view not working

三世轮回 提交于 2019-12-24 21:23:00
问题 Hi now My app doesn't show ads and search view it used to show before but I created navigation menu and it doesn't show them anymore. Here is my code. I couldn't paste it here because stack overflow doesn't let me MainActivity.java https://pastebin.com/zVQCQRAc ActivityMain.xml https://pastebin.com/UUbStvE0 Appbar_main.xml https://pastebin.com/4tR6B0Hm Content_main.xml https://pastebin.com/ipxy3gSU <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android

Show Single Item at a time in Recycler view

▼魔方 西西 提交于 2019-12-24 21:05:55
问题 I'm showing list of items in WearableRecyclerView. As of now I am getting like this But I need to show Single Row(Single Item) in a Page ,Scroll down,then show next Item. Any Help to do this in android app? 回答1: You can do it by two way. option 1: putting recycler view item width and height both to match_parent.which will cover the screen with with one item at a time and need to scroll for see the next item. option 2: use this library which will do the exact thing that you are looking for. 来源