Listview - Getview called multiple times - android

I have a ListView and a custom adapter. Now i have red posts about getView() method being called multiple times, and most of them have to do with the wrap_content feature of the ListView.
I have changed my height, so that it can be match_parent but still, the method is being called.
I think it has something to do with adding TextViews dynamically in the adapter, and i don't know how to do it, so it works properly.
If there is an alternative, i am opened to it, the only reason why i put TextViews is so that i can have letters written in different colors.
Here is my code:
#Override
public View getView(int position, View convertView, ViewGroup parent)
{
View v = convertView;
Row current = mList.get(position);
/* if the given channel row view is not being updated*/
if (v == null)
{
/* inflate layout */
LayoutInflater vi = LayoutInflater.from(getContext());
v = vi.inflate(R.layout.list_item2, null,false);
}
v = setLinearLayout(v,current);
return v;
}
Here is the setLinearLayout() method:
private View setLinearLayout(View v,Row current) {
ArrayList<Integer> winResults = current.checkNumbers(mResult,mType);
int numbers[] = current.getNumbers();
int N = Global.getNumberOfNumbers(mType);
boolean FLAG_SET = false;
final TextView[] myTextViews = new TextView[N]; // create an empty array;
for (int i = 0; i < N; i++) {
Log.d("PAVLE",""+i+" row is: "+current.getStringNumbers());
// create a new textview
final TextView rowTextView = new TextView(v.getContext());
LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,75);
rowTextView.setTextSize(24.0f);
rowTextView.setPadding(8, 8, 8, 8);
rowTextView.setGravity(Gravity.CENTER);
rowTextView.setBackgroundColor(Color.BLACK);
rowTextView.setTypeface(null, Typeface.BOLD);
rowTextView.setLayoutParams(lp);
if(mType == R.string.sans_topu && i == 5 && !FLAG_SET){
i--;
rowTextView.setTextColor(Color.WHITE);
rowTextView.setText("+");
FLAG_SET = true;
}
else {
// set some properties of rowTextView or something
if (mWin == Global.WIN || mWin == Global.LOSE) {
if (winResults.contains(numbers[i]))
rowTextView.setTextColor(Color.GREEN);
else rowTextView.setTextColor(Color.RED);
} else {
rowTextView.setTextColor(Color.WHITE);
}
if (numbers[i] < 10) {
rowTextView.setText("0" + numbers[i]);
} else rowTextView.setText("" + numbers[i]);
}
// add the textview to the linearlayout
LinearLayout ll = (LinearLayout) v.findViewById(R.id.ll_item);
ll.addView(rowTextView);
// save a reference to the textview for later
myTextViews[i] = rowTextView;
}
final TextView prize = new TextView(v.getContext());
LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,75);
prize.setTextSize(24.0f);
prize.setPadding(8, 8, 8, 8);
prize.setGravity(Gravity.CENTER);
prize.setBackgroundColor(Color.BLACK);
prize.setTypeface(null, Typeface.BOLD);
prize.setTextColor(Color.WHITE);
prize.setLayoutParams(lp);
try {
String cash = findCorretAmmount(winResults, numbers);
prize.setText(cash);
mTotal.append(" "+cash);
}
catch (Exception e){
e.printStackTrace();
}
LinearLayout ll = (LinearLayout) v.findViewById(R.id.ll_item);
ll.addView(prize);
return v;
}
And a little bit of XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/tvRandomTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:paddingRight="8dp"
android:text="#string/your_ticket_numbers_"
android:textColor="#android:color/black"
android:textSize="28sp"
android:textStyle="bold"
/>
<View
android:id="#+id/divider4"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/tvRandomTextView"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"
android:background="#android:color/darker_gray"/>
<ListView
android:id="#+id/lvRowList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/divider4"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
>
<Button
android:id="#+id/btnDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="#string/delete"/>
<Button
android:id="#+id/btnShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="#string/btn_share"/>
<Button
android:id="#+id/btnDone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="#string/done"/>
</RelativeLayout>
<TextView
android:id="#+id/tvResultLink"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"
android:autoLink="web"
android:gravity="center"
android:linksClickable="true"
/>
Also worth mentioning is that list_item2(LinearLayout) has height of 100dp, it's fixed size.

I think its not about textview.
The getView is always called multiple times. If you have 10 items on the screen to be shown, the getView going to be called 15 times, because the android creating views that are not on the screen. It`s good, because when the user start scrolling, it is not going to lagging.
After the user left the item, the view get`s recycle and reused by the adapter. Lets say, you have a list with 10000000 item, but you have 5 item on the screen at all time. In this case - to save power, and improve performance - the android going to create 10 list item, and this 10 item is going to recylce and refresh by content.
ViewHolder pattern
Please read this and use this patter to improve your code performance:
http://developer.android.com/training/improving-layouts/smooth-scrolling.html
Google about ListView:
http://developer.android.com/guide/topics/ui/layout/listview.html
Tutorials:
http://developer.xamarin.com/guides/android/user_interface/working_with_listviews_and_adapters/

Related

How can i make a spinner prompt multiline?

I have a spinner that allows me to not show the first item in the list, but i can set my custom prompt. However whenever the prompt text spans more than one line it is cut off at the view bounds. How can i make the spinner prompt expand to accommodate more text?
I have tried modifying the view passed into the adapter to have multiple lines and also to ellipsize at the end, but nothing works.
Images for clarity:
With one line of text,
With several lines,
This is my code:
languagesSpinner.setAdapter(new ArrayAdapter<>(EditProfileNationalityActivity.this, R.layout.no_default_spinner_item, new String[] {""}));
if(data.length>0) {
String countries = spokenLanguages.toString().substring(0, spokenLanguages.toString().length() - 2);
languagesSpinner.setPrompt(countries);
} else {
Log.e("setting prompt to default");
languagesSpinner.setPrompt("Please select languages");
}
and this is the xml file:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_gravity="center_vertical"
android:textColor="#android:color/black"
android:textSize="18sp"
android:ellipsize="end"
android:lines="2"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:background="?android:attr/activatedBackgroundIndicator" />
Per request, xml definition of spinner is as follows:
<com.package.views.NoDefaultSpinner
android:id="#+id/registration_stage_4_country_languages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:clickable="false" />
NoDefaultSpinner.java can be found here: https://github.com/geftimov/android-components/blob/master/components/src/main/java/com/eftimoff/components/views/spinners/nodefault/NoDefaultSpinner.java
I have modified it to have a custom getView() method in the SpinnerProxy like this:
if (position < 0) {
if (layoutResource == -1) {
layoutResource = R.layout.no_default_spinner_item;
}
final TextView v =
(TextView) ((LayoutInflater) getContext().getSystemService(
Context.LAYOUT_INFLATER_SERVICE)).inflate(
layoutResource, parent, false);
v.setText(getPrompt());
v.setPadding(0, 5, 0, 5);
return v;
}
return obj.getView(position, convertView, parent);
}
I edited your source code:
adapter = new ArrayAdapter<>(EditProfileNationalityActivity.this, R.layout.no_default_spinner_item, new String[] {""});
adapter.setDropDownViewResource(R.layout.no_default_spinner_item);
languagesSpinner.setAdapter(adapter);

Making a custom adapter show categorized items inside listview

I want to accomplish the below :
I want to categorize the items inside the listview, however, my listviews tend to appear only one rowed because I am only giving it one one (custom xml, extended custom baseadapter)
I checked this link , however it does not seem to do what I want to accomplish, any hints ?
You could add an initially hidden (View.GONE) header to your row's XML and fill it and show it when a category change is detected.
Another more efficient option would be inflating / creating and adding this header (which could be any kind of View or ViewGroup) programmatically when the category change is detected.
For example (first option):
row.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rowContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/txtGroupHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:padding="4dp"
android:background="#drawable/group_header_gradient"
android:gravity="center"
android:textColor="#android:color/white" />
<ImageView
android:id="#+id/imgLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:layout_marginLeft="3dp"
android:layout_marginRight="5dp"
android:layout_alignParentLeft="true"
android:layout_below="#id/txtGroupHeader" />
</RelativeLayout>
Adapter code
#Override
public View getView(int position, View convertView, ViewGroup parent){
View res = null;
Pojo ev = (Pojo)this.getItem(position);
Integer prevItemType = null;
//Get the type of the previous pojo in the list
if(position > 0){
Pojo prevEv = (Pojo)this.getItem(position - 1);
if(prevEv != null){
prevItemType = prevEv.getType();
}
}
//Determine if this view should have a header
boolean addHeaderView = !(prevItemType != null && prevItemType.equals(ev.getType()));
if(convertView != null){
res = convertView;
}else{
res = mInflater.inflate(R.layout.row, null);
}
TextView txtHeader = (TextView)res.findViewById(R.id.txtGroupHeader);
if(addHeaderView){
String typeName = Database.getTypeDescription(ev.getType());
if(typeName != null){
txtHeader.setText(typeName.toUpperCase(Locale.US));
}
txtHeader.setVisibility(View.VISIBLE);
}else{
txtHeader.setVisibility(View.GONE);
}
//Regular row
ImageView imgLogo = (ImageView)res.findViewById(R.id.imgLogo);
// ... imgLogo.setImageBitmap ...
// ... etc ...
return res;
}
Hope it helps.

Not sure how to dynamically add checkboxes in 2 columns

I am trying to display information from a database as checkboxes. Right now it works fine, but places one column of checkboxes on the screen. What I want to do is have it split into 2.
What it Does Now:
item1
item2
item3
item4
item5
What I Want:
item1 item2
item3 item4
item5
Preferably the new 2 column list would be evenly sized, each getting 50% of the screen, even if the text assigned is different lengths.
I have searched a lot, and tried like 3 different things. Havn't found anything that works. Below is my code as it is (creating one column).
private void listStudents()
{
st = (LinearLayout)findViewById(R.id.studTable);
ml = (RelativeLayout)findViewById(R.id.main);
ArrayList<ArrayList<String>> studentlst = new ArrayList<ArrayList<String>>();
studentlst = db.getAllStudentsRowsAsArrays();
final int sllen = studentlst.size();
final String student[][] = new String[sllen][3];
CheckBox cb[] = new CheckBox[sllen];
TextView pemail[] = new TextView[sllen];
int num = st.getChildCount();
if(num != 0) st.removeAllViews();
String tsl = sllen + "";
nos.setText(tsl);
for(int x=0; x < sllen; x++)
{
/************************
* student[x][case] *
* case options *
* 0 = id *
* 1 = name *
* 2 = email *
************************/
String curstudent = studentlst.get(x).toString();
student[x][0] = curstudent.substring(1,curstudent.indexOf(","));
student[x][1] = curstudent.substring(curstudent.indexOf(" ")+1,curstudent.lastIndexOf(","));
student[x][2] = curstudent.substring(curstudent.lastIndexOf(" ")+1, curstudent.length() - 1);
}
Arrays.sort(student, new Comparator<String[]>() {
#Override
public int compare(String[] entry1, String[] entry2) {
String name1 = entry1[1];
String name2 = entry2[1];
return name1.compareTo(name2);
}
});
for(int x=0;x<sllen;x++)
{
cb[x] = new CheckBox(this);
cb[x].setId(x+100);
cb[x].setText(student[x][1]);
pemail[x] = new TextView(this);
pemail[x].setText(student[x][2]);
pemail[x].setId(x+1000);
pemail[x].setVisibility(View.INVISIBLE);
st.addView(cb[x],x);
ml.addView(pemail[x],x);
}
}
XML File
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/lblmainselclass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="82dp"
android:layout_marginTop="7dp"
android:text="#string/lblmainselectclass" />
<Spinner
android:id="#+id/mainclassspinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/lblmainselclass" />
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="250dp"
android:layout_below="#+id/lblmainselstudents"
android:layout_centerHorizontal="true" >
<LinearLayout
android:id="#+id/studTable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<TextView
android:id="#+id/lblmainselstudents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/mainclassspinner"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="#string/lblselectstud" />
<Button
android:id="#+id/btnsend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="#string/btnlblsend" />
<Spinner
android:id="#+id/mainresponsespinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/btnsend"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp" />
<TextView
android:id="#+id/mainnumofstudents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="#string/invis"
android:visibility="invisible" />
<TextView
android:id="#+id/classselected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="#string/invis"
android:visibility="invisible" />
<TextView
android:id="#+id/responseselected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="#string/invis"
android:visibility="invisible" />
<TextView
android:id="#+id/numchecked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="#string/invis"
android:visibility="invisible" />
Old question, but I found myself here so I'll go ahead and answer it. There are a couple ways, but here's how I did it.
First, get your data and populate an ArrayList of Checkboxes:
ArrayList<CheckBox> checkboxes = new ArrayList<CheckBox>();
for (String s : dataArray) {
CheckBox cBox = new CheckBox(myContext); //or inflate it from xml if you have a defined style
cBox.setText(s);
checkboxes.add(cBox);
}
Then create a class that extends BaseAdapter along with a supporting static class. We will bind the data to the adapter assuming your CheckBox ArrayList is an instance variable. If not, you can create a constructor in the BaseAdapter class access checkboxes that way.
private class CheckboxGridAdapter extends BaseAdapter {
#Override
public int getCount() {
return checkboxes.size();
}
#Override
public Object getItem(int pos) {
return checkboxes.get(pos);
}
#Override
public long getItemId(int pos) {
return 0;
}
#Override
public View getView(int pos, View convertView, ViewGroup parent) {
final ViewPlaceHolder holder;
final CheckBox item = (CheckBox) getItem(pos);
if (convertView == null) {
holder = new ViewPlaceHolder();
holder.cb = (CheckBox) item;
convertView = holder.cb;
convertView.setTag(holder);
} else {
holder = (ViewPlaceHolder) convertView.getTag();
}
return convertView;
}
}
static class ViewPlaceHolder {
CheckBox cb;
}
Finally, back where you created the ArrayList of Checkboxes, create a GridView (either programmatically or by inflating an xml resource), then attach the BaseAdapter. Don't forget to set the number of columns, that's the whole point of this post after all.
GridView grid = new GridView(myContext);
grid.setNumColumns(2);
grid.setAdapter(new CheckboxGridAdapter());
You should use a custom ListView and a BaseAdapter for efficency if you have many entries.
You can find good examples to start with in the SDK ApiDemos (android-sdk/samples/android-x/ApiDemos).
You should use a GridView instead of your ScrollView. This way you can dynamically create your items and have two (or more columns)

Dynamically hiding text in ListView - Not always working

I'm trying to set a TextView object to disappear in a ListView row if the TextView object has no text inside it.
#Override
public View getView(int position, final View convertView, ViewGroup parent) {
View row = convertView;
if (row == null) {
final LayoutInflater inflater = getLayoutInflater();
row = inflater.inflate(R.layout.members, parent, false);
}
final TextView header = (TextView) row.findViewById(R.id.listHeader);
header.setText(parsedList.get(position).header);
final TextView footer = (TextView) row.findViewById(R.id.listDescription);
if(parsedList.get(position).footer.length() == 0) {
footer.setVisibility(View.GONE);
} else {
footer.setText(parsedList.get(position).footer);
}
return row;
}
Manifest:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/listHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" android:layout_marginLeft="12dp" android:layout_marginRight="12dp" android:layout_marginTop="6dp" android:layout_marginBottom="6dp"/>
<TextView
android:id="#+id/listDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall" android:layout_marginBottom="6dp" android:layout_marginLeft="24dp" android:layout_marginRight="12dp"/>
</LinearLayout>
When the Activity loads, everything displays as it should (Most of the time). However when I rotate the screen, some of the footer TextView objects disappear from the screen. This is even though when I run the debugger, footer.setVisibility(View.GONE); is never called.
Also in my manifest I have android:configChanges="orientation|keyboardHidden" set for the Activity.
EDIT: This issue also rarely occurs when the Activity is created. However it always occurs on screen rotation.
Replace With This.
if(parsedList.get(position).footer.length() == 0) {
footer.setVisibility(View.GONE);
} else {
footer.setText(parsedList.get(position).footer);
footer.setVisibility(View.VISIBLE);
}
Override this method in Activity:
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
Have you tried using getText().length() in the if statement?
if(parsedList.get(position).footer.length() == 0)

Centering 2 Textviews in LinearLayout, text only shown when scrolling

I'm trying to center two textViews that are in a LinearLayout. This LinearLayout is nested in another one, with a ListView-element.
I think my XML is pretty correct. I fill my textViews dynamically in my Adapterclass.
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
<TextView android:layout_height="wrap_content"
android:id="#+id/atlVacaturesnummer"
android:layout_width="wrap_content"
android:textColor="#color/Accent"
android:text="x"
/>
<TextView android:layout_height="wrap_content"
android:id="#+id/atlVacatures"
android:layout_width="wrap_content"
android:text="y"
/>
</LinearLayout>
<ListView android:id="#+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:drawSelectorOnTop="false" />
<TextView android:layout_height="fill_parent"
android:id="#+id/android:empty"
android:layout_width="fill_parent"
android:text="Er zijn geen jobs die voldoen aan uw criteria..."
android:gravity="center"/>
</LinearLayout>
Adapterclass:
/*
* Klasse VacatureAdapter
*/
private class VacatureAdapter extends ArrayAdapter<Vacature>{
private ArrayList<Vacature> vacatures;
public VacatureAdapter(Context context, int textViewResourceId, ArrayList<Vacature> vacatures){
super(context, textViewResourceId, vacatures);
this.vacatures = getArray();
//System.out.println("Array vacatureadapter: " + v);
}
#Override
public View getView(int position, View convertview, ViewGroup parent){
View view = convertview;
if(view==null){
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = vi.inflate(R.layout.vacature_list_item, null);
//view.setBackgroundColor((position % 2) == 1? Color.LTGRAY: Color.WHITE);
}
TextView atlVacatures = (TextView)findViewById(R.id.atlVacatures);
TextView atlVacaturesnr = (TextView)findViewById(R.id.atlVacaturesnummer);
atlVacaturesnr.setText("" + arrVacatures.size());
atlVacatures.setText(" jobs op maat gevonden!");
Vacature vaca = vacatures.get(position);
if(vaca != null){
TextView tvNaam = (TextView) view.findViewById(R.id.vacatureNaam);
TextView tvWerkveld = (TextView) view.findViewById(R.id.vacatureWerkveld);
TextView tvRegio = (TextView) view.findViewById(R.id.vacatureRegio);
if(tvNaam != null){
tvNaam.setText(vaca.getTitel());
if(tvWerkveld != null){
tvWerkveld.setText("Werkveld: " + vaca.getWerkveld());
if(tvRegio!=null){
tvRegio.setText("Regio: "+vaca.getRegio());
}
}
}
}
return view;
}
}
The weird thing is that if my spinner runs, he shows the texts set in my XML correctly, if the spinner stops and fills my ListView it only shows one digit of my number and when I scroll once he shows my number completly plus the second TextView. I don't quite understand what's wrong, maybe some code needs te be put somewhere else?
I've solved my problem by putting my setText code in my Runnable method, after I dismiss my Dialog. Now It looks like this:
private Runnable returnRes = new Runnable(){
public void run(){
if (arrVacatures.size() == 0){
dialog.dismiss();
}
if(arrVacatures!=null && arrVacatures.size() > 0){
adapter.notifyDataSetChanged();
for(int i= 0; i< arrVacatures.size();i++){
adapter.add(arrVacatures.get(i));
}
dialog.dismiss();
TextView atlVacatures = (TextView)findViewById(R.id.atlVacatures);
TextView atlVacaturesnr = (TextView)findViewById(R.id.atlVacaturesnummer);
atlVacaturesnr.setText("" + arrVacatures.size());
atlVacatures.setText(" jobs op maat gevonden!");
adapter.notifyDataSetChanged();
}
}
};

Categories

Resources