adapter

Custom rows in ListView with custom Adapter

此生再无相见时 提交于 2019-12-13 04:50:16
问题 I made the following adapter which I used before to create rows that are the same all the time. I removed the creation of the textviews and imageviews. What I want to achieve is to create different rows depending on the key. A row could contain text and an image while another row only has text. How would I be able to do that? public class DetailsListAdapter extends ArrayAdapter<ArrayList<String>> { private Context context; private ArrayList<String> keys; public DetailsListAdapter(Context

ListAdapter getView with wrong value for position

余生长醉 提交于 2019-12-13 04:43:33
问题 This question addresses fundamentally the same problem as Old Version Its re-written, because the code is much more readable, and i changed the adapter from a BaseAdapter extension to a ListAdapter interface implementation (wich was pointless). I have this weird problem with position variable inside getView method of the adapter. 4 of those 6 different view types, got a button inside them. That button sends a message to a service (provoking some async stuff on the service), and within an

Third sub activity in a Tab not working due to listview in second

浪尽此生 提交于 2019-12-13 04:28:20
问题 I have a TabInterface.java which hosts five tabs. In one of the tab, I am using subactivities.When I click on the AddBook tab (which extends ActivityGroup) the search book page loads properly. When I click on search button a list of books is generated. When I click on the book, a new page must open but its program is running properly but not displaying any thing on the screen. TabInterface.java public class TabInterface extends TabActivity { super.onCreate(savedInstanceState); setContentView

Unresolved reference: LAYOUT_INFLATER_SERVICE inside onBindViewHolder

半世苍凉 提交于 2019-12-13 03:56:06
问题 Inside OnBindViewHolder of my RecyclerView Adapter , I got multiple items. One of those (ITEM_TRATAMENTOS) got a setOnClickListener which has the purpose of create an LinearLayout when I click in an button (add_field_btn). The problem is that the only argument of getSystemService is unresolved ( Context.LAYOUT_INFLATER_SERVICE ). In ViewPagers it works fine, but inside OnBindViewHolder, it's not the case. ITEM_TRATAMENTOS ->{ val viewHolderTratamentos = holder as ViewHolderItemTratamentos

many listview and each one contains different objects in Kotlin

送分小仙女□ 提交于 2019-12-13 03:53:38
问题 I have 2 activity and when click on first activity to be converted to second activity it's Main2Activity inside 2nd activity I am trying to make many ListView and each one contains pictures and text, each ListView inside one specific adapter but i get a problem for represent ( adapterType1 , adapterType2 ) both adapters ( adapterType1 , adapterType2 ) return the same value of ( adapterType1 ),and i wanna to return two different result for ( adapterType1 ) and ( adapterType2 )? Here is a

like unlike button recyclerView image

不问归期 提交于 2019-12-13 03:12:16
问题 I have an android app in which users can like and unlike an image.I'm using recyclerView.I Just disable the button(Like/Unlike) once user clicked. Problem, when I click on button like , the apps go to main activity and the button Like doesn't change to unlike What I have done : 1 ) layout that holds the each recycler view layout item 2 ) A view holder for creating each layout 3 ) A Model Class to holds the data 4 ) Recycler Adaptor which deals with the data for the Each Layout item Hier ist

android: recycler view adapter

痞子三分冷 提交于 2019-12-13 02:58:09
问题 I am new to recycler view widget , i want to get my data from my api url and list the data into my recycler view , i have these classes : recyclerAdapter , recyclerView , MainActivity , row . the data is loaded from api succesfully but the does not set the json string received from the api in the recycler view , and the recycler view is shown white and empty . any body can find the problem in my code ? MainActivity.java code is : public class MainActivity extends AppCompatActivity { final

Reading JSON boolean value

扶醉桌前 提交于 2019-12-13 02:40:00
问题 In my app I have a boolean variable inside my json response. [ { "id" : "001", "firstName" : "Mark", "lastName" : "Mason", "role" : "CEO", "profileImageURL" : "http://developers.mub.lu/resources/profilePlaceholder.png" }, { "teamName" : "iOS", "members" : [ { "id" : "002", "firstName" : "Olly", "lastName" : "Berry", "role" : "iOS Team Lead", "profileImageURL" : "http://developers.mub.lu/resources/profilePlaceholder.png", "teamLead" : true }, { "id" : "003", "firstName" : "James", "lastName" :

Using var_arg to pass parameters for function calls

核能气质少年 提交于 2019-12-13 02:13:18
问题 I am writing an adapter to combine two APIs (one in C and another in C++). If a function is called on the one API I need to pass the callers ID and the function's arguments to an adapter and call the according function with this information passed. Now aparently they can not be mapped directly as one interface requires C++ compilation and the name mangling would screw the other so that is why I am using a set of adapters in the first place. As the number of arguments varies, I looked up

ListView not populating, or WebView taking up entire screen?

时光毁灭记忆、已成空白 提交于 2019-12-13 01:22:29
问题 I have code that should populate my ListView in my UrlListFragment, but when I run it I see no effect. I put the problem aside to work on my WebView, and found that once I load a URL it uses the entire screen. I'm not sure if this means my ListView isn't being populated, so it doesn't take up space, so the WebView takes up the entire screen, or if the WebView is taking up the entire screen regardless of whether the ListView is being populated or not. I populate my ListView like this: View