Questions tagged [android-arrayadapter]

1

votes
2

answer
26

Views

My adapter not update correctly my listview option

I have the next problem. When I delete an item from my ListView in my adapter the state of the CheckBox change from item in list, Why? and, how can solve this problem? public class CustomAdapter extends ArrayAdapter implements View.OnClickListener { private ArrayList DataSet; Context context; public...
0

votes
0

answer
6

Views

how to support all screen sizes when using more than one spinner?

I am making a new app and I am a beginner so kindly help me with this, my layout is working great if I run without any java code for layout but when I use Java code, my layout is going beyond the screen I have tried to make different layout folders such as layout-sw320dp.... public class Main2Activi...
ashim
1

votes
2

answer
289

Views

Setting up multiple spinners in android

I have 2 spinners in my project and so far only have one spinner working! i am trying to have 2 spinners that when selected change the image in the imageview! the first spinner takes data from an array in the strings.xml and would also like the second array to do the same and update the imageview li...
David Marsh
1

votes
1

answer
134

Views

how to create custom adapter with listview and use it within jsoup onpostexecute

I am using jsoup to scrape html from a web page. But I am unable to get data into two text views in my listview. I am using ArrayAdapter and i can set text to one text view. how can i create a custom adapter to get text in two textview with jsoup?
Ahu Son
1

votes
2

answer
2.1k

Views

Inserting Separator in ListView using Array Adapter

Scenario : I have n number of tabs each tab is having its own listview. I am using a Array adapter to generate a listview. The array which is passed to arrayadaper is having array of objects. Each object has and . Now based on the menu type, if the menu type is "menugroup" i need to draw using a di...
user1822729
1

votes
2

answer
404

Views

ArrayIndexOutOfBoundsException occurs

I am using BaseAdapter: public class MyAdapter extends BaseAdapter{ private final LayoutInflater mInflater; private final String[] mItems; private final String[] mClasses; private final Drawable[] mIcons; private final Integer mii; public MyAdapter(Activity c, String[] objects, Drawable[] dricons,...
timonvlad
1

votes
1

answer
136

Views

Android: passing string into ArrayAdapter

I have a spinner and i am dynamically loading the spinner with messages i am doing it as below protected List messages = null; ArrayAdapter arrayadapter = new ArrayAdapter( activity,android.R.layout.simple_spinner_item,messages); spinner1.setAdapter(arrayadapter); i am getting the...
teekib
1

votes
2

answer
498

Views

Problematic Custom Adapter ocasionally Null in ListFragment

So this problem happens only some times. There is no rhyme or reason that I can see. I suspect, the faster the user moves around the app, the more likely it happens. Here is LogCat: 02-20 12:09:58.526: E/AndroidRuntime(18777): FATAL EXCEPTION: main 02-20 12:09:58.526: E/AndroidRuntime(18777): ja...
KickingLettuce
1

votes
1

answer
713

Views

get selected item value throws IndexOutOfBoundsException

I create a list in a fragment with some mp3 files, then I pass this list to another fragment, which works, in this fragment I try to get the item value when the user presses one. This following line of code does the job in the fragment where the list is created, but in this fragment it throws an In...
Jakob
1

votes
2

answer
1.9k

Views

Android spinner crashing when clicked on

I have a spinner on my page, which is populated using an arrayAdapter. When i launch my app everything is ok, but the moment i click on the spinner, the app crashes and logcat gives me no reference to a line in my code. Here is the area of the code referring to the spinner: profiles = (Spinner) find...
arielschon12
1

votes
1

answer
8k

Views

Dynamically adding textview to listview

I'm trying to add textview to listview dynamically. Before adding im setting the text but in the listview text seems something like '[email protected]' private ArrayAdapter dizi; private ListView list; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedIn...
tlgtkn
1

votes
1

answer
875

Views

The method openFragmentTransaction() is undefined for the type new ActionBar.OnNavigationListener(){}

When I'm referring to Android Developers link to make a dropdown list, I got an error in Eclipse: The method openFragmentTransaction() is undefined for the type new ActionBar.OnNavigationListener(){} This is the segment of example code given by the website (to date): mOnNavigationListener = new OnNa...
Neoh
1

votes
1

answer
5.5k

Views

how Create setAdapter() for a AlertDialog

I created a CustomDialogBuilder that extends Dialog... I want to create the method setApater().. I created that section but the onClick method on the adapter is not working.. My customDialogBuilder class is given below. public class CustomAlertDialog extends Dialog { public CustomAlertDialog(Contex...
Vikky
1

votes
1

answer
1.4k

Views

Universal ImageLoader java.io.EOFException

I'm trying to fetch JSON data and display it in my ListView using ArrayAdapter. Anyways, in my adapter, I'm using Universal Image Loader from https://github.com/nostra13/Android-Universal-Image-Loader and the other data were loaded correctly except for the images. Some images were displayed correctl...
Compaq LE2202x
1

votes
1

answer
304

Views

ListView Adapter issue in android

Here is my code to browse through all folders in device. private File file; private List directoriesList; private ListView listView ; private ArrayAdapter adapter; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.folder_browse_screen); li...
Santhosh
1

votes
2

answer
3.7k

Views

arrayadapter for spinner not working in fragment, requires resource id

i am getting an error that ArrayAdapter does not have resource id, however the resource id is used here and i used similar code in an activity with no problem however this is in a fragment. is there something i am supposed to do differently because it is in a fragment? and that is why it is not wo...
Kevik
1

votes
2

answer
2.6k

Views

How to get the instances of all views created by an adapter?

I have a ArrayAdapter for a GridView, As you can see in the code I populate the GridView using the getView method with a custom view that called: GridViewCell. Now on a click of this custom view there is a FlipAnimation method run that works great for the clicked view. what I want to achieve is to r...
Emil Adz
1

votes
2

answer
1.9k

Views

The constructor ArrayAdapter<String>(FragmentActivity, int, int, int, List<String>) is undefined

I have used ListFragment in that i have used below code public class TestListFragment extends ListFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); ArrayAdapter adapter = new ArrayAdapter(getActivity(),R.layout.list_column, R...
Siddhpura Amit
1

votes
3

answer
4.6k

Views

Update or change adapter in Listview

I have question for list-view please see my below code private void set_adapter() { Cursor list_scan_curson = scan_result.getScanResult(); List list_scan = new ArrayList(); try { if (list_scan_curson.moveToFirst()) { do { String name = list_scan_curson.getString(0); // Adding contact to list list_s...
Ando Masahashi
1

votes
1

answer
2.6k

Views

Resetting an Autocompletetextview with a custom arrayadapter and filter

I'm having trouble with an autocompletetextview. When I first start the app the autocompletetextview work's as expected, I can type in 'm' and get a list of all restaurants which start with 'm'... Then when I type more, 'mark', the list updates as expected... However the problem happens when I d...
Reustonium
1

votes
2

answer
898

Views

Android ListView shows the same items

I have two ListView and one adapter on them for previous and future items. StepAdapter quoteStepAdapter = new StepAdapter(RequestDetail.this, R.layout.lv_step, quoteInitiationStepsList); ListView qouteStepListView = (ListView) findViewById(R.id.quote_step_list); qouteStepListView.setAdapter(quoteSt...
Ray
1

votes
2

answer
917

Views

Unable to start activity ComponentInfo{com.example.list/com.example.list.editbox}: java.lang.NullPointerException

i am trying to save the data in list view using Shared Preferences but im getting some errors. i have 2 classes one is main activity and 2nd is editbox. MainActivity.java public class MainActivity extends Activity { ListView listView1=null; @Override protected void onCreate(Bundle savedInstanceStat...
user3136235
1

votes
2

answer
922

Views

TextView not appearing in ListView with Custom Adapter

I have a ListView that I'm trying to populate using an ArrayAdapter (custom adapter class). The problem is that the TextView that I have made inside of the list_item.xml is not appearing. This is strange because in this xml I also created an ImageView and that is showing up. Here is my code: FontLis...
user3307102
1

votes
2

answer
2.4k

Views

Using GridView inside Fragment with ArrayAdapter<String>

I am creating a fragment where I want to display a simple gridview that will be generated from a StringArray. I don't need anything complicated, the basic ArrayAdapter works just fine for creating the gridview when not in a fragment. However, when I try to run it, I keep getting a nullpointerexcepti...
JMGoodwin
1

votes
2

answer
540

Views

Adding multiple views to row of ListView dynamically

I am trying to make a chat client where my user will be able to send text, image, video, music file etc. I know how to add dynamically row for list, however it just adds the String to the ArrayList and reflect on the list through ArrayAdapter. For me it's unpredictable, user can add String, video, i...
Saty
1

votes
1

answer
2.8k

Views

Android Cannot update ArrayAdapter because “Non-Static method 'notifyDataSetChanged()' cannot be referenced from a static context”

I'm using a bit of code to help me with pulling data from the web called WebRequest (https://github.com/delight-im/Android-WebRequest). It provides a callback for retrieving asynchronous data. However I can't update my ArrayAdapter because I get an error "Non-Static method 'notifyDataSetChanged()'...
Scott
1

votes
2

answer
2.6k

Views

Array Adapter Load Images from Res Folder (Android App)

Am an Android newbiew. Am trying to load a bunch of images in my res/Drawable folder into a Gridview via an array adapter. unfortunately my the app crashes each time i try to view the activity with the gridView. i would like to know how to set the imageResource of image i have in the res folder to d...
Donnie Ibiyemi
1

votes
1

answer
2.6k

Views

TextWatcher for EditText in ListViewText with custom ArrayAdapter (and getView recycling)

I have a ListView with a custom ArrayAdapter that uses a list of OrderedProductItems (my own Model-class). In this ArrayAdapter's getView I use the ViewHolder design pattern: @Override public View getView(int position, View convertView, ViewGroup parent){ View view = convertView; MyHolder h; if(view...
Kevin Cruijssen
1

votes
2

answer
50

Views

ArrayAdpater illegalStateException on android

i use an arrayAdpater for my listView, but i' m getting this exception and i don't understand why , i inserted the id of my layout.xml and the id of the listView when i initialized the arrayAdpater, but i can't figure out to solve this issue. create_boundary_map.xml (file on which is defined the lis...
Yokupoku Maioku
1

votes
2

answer
2.4k

Views

context parameter for custom adapter - getApplicationContext() fails but 'this' works

I have simple code snippet to implement custom list view. In this code, I have CustomAdapter class which extends ArrayAdapter: CustomAdapter adapter = new CustomerAdapter(getApplicationContext(),R.layout.listview_item_row, weather_data); The constructor of CustomAdapter is as below: public CustomerA...
Fenil
1

votes
1

answer
617

Views

Custom ArrayAdapter with no List type parameter

I want to create my own ArrayAdapter calling just the super constructor that has only 2 parameters, the context and the resource layout id. The problem is that the getView method is never called if I use that constructor, but if I use the other constructors were I pass a List object parameter or an...
CipQuestion
1

votes
1

answer
525

Views

adapter.add(event) throws java.lang.UnsupportedOperationException

I am making an application. I want to add more item after getting the information from server in a asynctask and save with a object defined by me. This is my code. EventCheck.java private void put(final Event event){ if(event!=null){ events = push(events,event); Log.d("no after= ",Integer.toString(e...
Ken CHAN
1

votes
1

answer
136

Views

ArrayAdapter is not updating

I have recently started working on an android app (I am pretty new to the platform). I was just trying to write a simple todo app to learn how array adapters work. --So once I enter text in the myTextView and press "Enter", I want text to show up in a list view below. As shown in the picture nothin...
niranjanbajgai
1

votes
2

answer
125

Views

Need to Display only one Object in my list view (Only title ) in my case

I am working with a Listview where I get a Json response which I parse using Gson and the response contains title, body and images. For my list view I need to display on titles I am doing the following: Articles[] testCase = gson.fromJson(Bundlekey, Articles[].class); @SuppressWarnings("rawtypes")...
MR Mido
1

votes
2

answer
3.5k

Views

ViewHolder pattern issue. Same OnClickListener set for all buttons inside ArrayAdapter

I can't figure out where am I wrong. I have created a button inside my custom ListView Adapter, I have implemented the ViewHolder pattern and set up an OnClickListener for the button. The problem is, whenever I click on the button on any row, I get the same result for clicks. Same title, same userna...
Edmond Tamas
1

votes
3

answer
233

Views

Android application stops

When app loads this activity it stops working.Below is my code for main activity, logcat and required array. Please help me resolve this issue. In this, when user selects any item from spinner then according to selected item another list item loads results. MainActivity: Button cropPrice; @Override...
Ravi Bhalodiya
1

votes
2

answer
918

Views

section indexer get section for position returns 0

In my project I have class that extends ArrayAdapter and implements SectionIndexer. When implementing methods getPositionForSection and getSectionForPosition I have found some strange behaviour. Why section indexer works properly when getSectionForPosition returns 0? public int getSectionForPositi...
tymbark
1

votes
5

answer
813

Views

Error in ArrayAdapter - layout inflator thows error

Am getting the following warning in Eclipse: "Unconditional layout inflation from view adapter: Should use View Holder pattern (use recycled view passed into this method as the second parameter) for smoother scrolling" The code which i had used is: class myadapter extends ArrayAdapter { Context cont...
Vinesh Senthilvel
1

votes
2

answer
1.6k

Views

List view setAdapter in fragment, null pointer exception

I ran into this null pointer exception at setAdapter for listView. Both the listView and the Adapter are NOT null. What's the issue here? OnCreateView of fragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View dataSearch = inflater...
Sndn
1

votes
1

answer
209

Views

ArrayAdapter getView position is not true

For my ListView I have this ArrayAdapter ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, android.R.id.text1, uas) { @Override public View getView(int position, View convertView, ViewGroup parent) { View item = super.getView(position, convertView, parent); if(uas.si...
Phil

View additional questions