listview not getting displayed - java

I am trying to filter data from database and display filtered data into listview using cursor. Unfortunately, the cursor is returned from the query isn't empty but the items not getting displayed in the activity.And moreover, there's no error being displayed in the logcat.
My search_results.java:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search__results);
lview = (ListView) findViewById(R.id.list);
Intent intent = getIntent();
String from = intent.getStringExtra("from");
String to = intent.getStringExtra("to");
// String date = intent.getStringExtra("date");
// String clas = intent.getStringExtra("class");
myrailway = new no.nordicsemi.android.nrftoolbox.myRailwayAdapter(this);
// Cursor cursor = myrailway.getTrainDetails(from, to);
String[] FROM = null;
String[] TO = null;
String[] TRAINNAME = null;
String[] TRAINNO = null;
String[] DEPART = null;
String[] ARRIVAL = null;
Cursor cursor = myrailway.getTrainDetails(from, to);
if(cursor != null) {
Log.e("ERROR","NON EMPTY CURSOR");
int count = 0;
if (cursor.moveToFirst()) {
Log.e("ERROR","ENTERED LOOP");
do {
String stnfrom = cursor.getString(cursor.getColumnIndex(no.nordicsemi.android.nrftoolbox.myRailwayAdapter.CONTACTS_COLUMN_STNFROM));
String stnto = cursor.getString(cursor.getColumnIndex(no.nordicsemi.android.nrftoolbox.myRailwayAdapter.CONTACTS_COLUMN_STNTO));
String trainname = cursor.getString(cursor.getColumnIndex(no.nordicsemi.android.nrftoolbox.myRailwayAdapter.CONTACTS_COLUMN_NAME));
String trainno = cursor.getString(cursor.getColumnIndex(no.nordicsemi.android.nrftoolbox.myRailwayAdapter.CONTACTS_COLUMN_TRAINNUM));
String depart = cursor.getString(cursor.getColumnIndex(no.nordicsemi.android.nrftoolbox.myRailwayAdapter.CONTACTS_COLUMN_DEPART));
String arrival = cursor.getString(cursor.getColumnIndex(no.nordicsemi.android.nrftoolbox.myRailwayAdapter.CONTACTS_COLUMN_ARRIVAL));
FROM[count] = stnfrom; Log.e("fr",stnfrom);
TO[count] = stnto; Log.e("too",stnto);
TRAINNAME[count] = trainname; Log.e("trainanme",trainname);
TRAINNO[count] = trainno; Log.e("trainno",trainno);
DEPART[count] = depart; Log.e("depart",depart);
ARRIVAL[count] = arrival; Log.e("arrival",arrival);
count = count + 1;
cursor.close();
} while (cursor.moveToNext());
lviewAdapter = new ListViewAdapter(this, FROM, TO, DEPART, ARRIVAL, TRAINNAME, TRAINNO);
lview.setAdapter(lviewAdapter);
}
}
else
Log.e("ERROR","EMPTY CURSOR");
}
My ListViewAdapter.java:
public class ListViewAdapter extends BaseAdapter {
Activity context;
String from[];
String to[];
String depart[];
String arrival[];
String trainname[];
String trainno[];
private no.nordicsemi.android.nrftoolbox.myRailwayAdapter myrailway;
public ListViewAdapter(Activity context, String[] from, String[] to, String[] depart, String[] arrival, String[] trainname, String[] trainno) {
super();
this.context = context;
this.from = from;
this.to = to;
this.depart = depart;
this.arrival = arrival;
this.trainname = trainname;
this.trainno = trainno;
}
#Override
public int getCount() {
return depart.length;
}
#Override
public Object getItem(int i) {
return depart[i];
}
#Override
public long getItemId(int i) {
myrailway = new no.nordicsemi.android.nrftoolbox.myRailwayAdapter(this.context);
Long recc= Long.valueOf(0);
Cursor c= myrailway.getpass(trainname[i]);
if(c!=null)
{
c.moveToFirst();
recc=c.getLong(0);
}
return recc;
}
private class ViewHolder {
TextView txtfrom;
TextView txtto;
TextView txttrainno;
TextView txttrainname;
TextView txtdepart;
TextView txtarrival;
}
#Override
public View getView(int position, View view, ViewGroup viewGroup) {
ViewHolder holder;
LayoutInflater inflater = context.getLayoutInflater();
if (view == null)
{
view = inflater.inflate(R.layout.listview_items, null);
holder = new ViewHolder();
holder.txtfrom = (TextView) view.findViewById(R.id.from);
holder.txtto = (TextView) view.findViewById(R.id.to);
holder.txttrainno = (TextView) view.findViewById(R.id.trainno);
holder.txttrainname = (TextView) view.findViewById(R.id.trainname);
holder.txtdepart = (TextView) view.findViewById(R.id.depart);
holder.txtarrival = (TextView) view.findViewById(R.id.arrival);
view.setTag(holder);
}
else
{
holder = (ViewHolder) view.getTag();
}
holder.txtfrom.setText(from[position]);
holder.txtto.setText(to[position]);
holder.txttrainno.setText(trainno[position]);
holder.txttrainname.setText(trainname[position]);
holder.txtdepart.setText(depart[position]);
holder.txtarrival.setText(arrival[position]);
return view;
}
}
My search_results.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="no.nordicsemi.android.nrftoolbox.Search_Results">
<ListView
android:id="#+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</RelativeLayout>
My listview_items.xml:
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="0dip" android:layout_gravity="top"
>
<TableRow>
<TextView
android:id="#+id/from"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1" android:layout_gravity="left|center_vertical"
android:textSize="16sp"
android:layout_marginLeft="10dip"
android:layout_marginTop="4dip"
android:textColor="#000000"
android:layout_span="1"
/>
<TextView
android:id="#+id/to"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1" android:layout_gravity="left|center_vertical"
android:textSize="16sp"
android:layout_marginLeft="10dip"
android:layout_marginTop="4dip"
android:textColor="#000000"
android:layout_span="1"
/>
</TableRow>
<TableRow>
<TextView
android:text=""
android:id="#+id/trainno"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:textSize="16sp"
android:textColor="#000000"
android:layout_marginLeft="10dip"
android:layout_marginTop="4dip"
android:gravity="left"/>
<TextView
android:text=""
android:id="#+id/trainname"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:textSize="16sp"
android:textColor="#000000"
android:layout_marginLeft="10dip"
android:layout_marginTop="4dip"
android:gravity="left"/>
</TableRow>
<TableRow>
<TextView
android:text=""
android:id="#+id/depart"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:textSize="16sp"
android:textColor="#000000"
android:layout_marginLeft="10dip"
android:layout_marginTop="4dip"
android:gravity="left"/>
<TextView
android:text=""
android:id="#+id/arrival"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:textSize="16sp"
android:textColor="#000000"
android:layout_marginLeft="10dip"
android:layout_marginTop="4dip"
android:gravity="left"/>
</TableRow>
</TableLayout>
<Button
android:id="#+id/book"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:onClick="book"
android:text="BOOK">
</Button>
</TableRow>
</TableLayout>
Now, the cursor isn't empty but the listview is not displayed by the listview adapter.
Can someone point out the error in the code??

Please use this.
#Override
public int getCount() {
//here too;
return depart.lenght;
}
#Override
public Object getItem(int i) {
//there is error: repalce return null; with
return depart[i];
}
#Override
public long getItemId(int i) {
//change this too
return depart[i].getId();
}

I can see 2 reasons that this may happen:
You arrays are not filled with data/or filled with empty data and that the reason they are not presented. (less likely because you would receive a null pointer exception when you try to access a null location in the array)
Your row layout doesn't show data parameters. (I will be
on this reason, please show you row layout XML(listview_items.xml) so that we could check
it)
Check: Make a check and print to the log all the data from 6 the arrays for every row before you set the data in the getView method.

getCount(), getItem() and getItemId() are not set properly.
getCount() should return the number of items in the arraylist;
getItem() should return the item at the given position from the arraylist;
getItemId() should return the internal id of the item if it has one, or the position of the item in the array or an hash number of the item.

Related

How to add multiple values inside 1 list view and style it approriatle

I want to be able to add multiple values on a list but properly style the list view.
For example right now the list view will look like this:
namepostcodedate
which is because of the following code
ListArray.add(jobs.get(finalJ).customer.getName() + job.getPostcode() + job.getDate());
The way that I am currently adding the values in the ListArray doesn't seem ideal but I am not sure if there is another way to do this and display the list formated?
This is my list_item file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dip">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TableRow
android:id="#+id/rows2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/ddOrangeLight"
android:showDividers="middle">
<!-- android:divider="?android:attr/dividerHorizontal"-->
<TextView
android:id="#+id/customerNameView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="4sp"
android:layout_marginTop="10dp"
android:layout_marginEnd="4sp"
android:layout_marginBottom="10dp"
android:gravity="center"
android:textColor="#color/black"
android:textSize="18sp"
android:textStyle="bold" />
</TableRow>
</TableLayout>
</RelativeLayout>
My adapter class
public class SearchableAdapter extends BaseAdapter implements Filterable {
private List<String>originalData = null;
private List<String>filteredData = null;
private final LayoutInflater mInflater;
private final ItemFilter mFilter = new ItemFilter();
public SearchableAdapter(Context context, List<String> data) {
this.filteredData = data ;
this.originalData = data ;
mInflater = LayoutInflater.from(context);
}
public int getCount() {
return filteredData.size();
}
public Object getItem(int position) {
return filteredData.get(position);
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
// A ViewHolder keeps references to children views to avoid unnecessary calls
// to findViewById() on each row.
ViewHolder holder;
// When convertView is not null, we can reuse it directly, there is no need
// to reinflate it. We only inflate a new View when the convertView supplied
// by ListView is null.
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_item, null);
// Creates a ViewHolder and store references to the two children views
// we want to bind data to.
holder = new ViewHolder();
holder.uName = (TextView) convertView.findViewById(R.id.customerNameView);
// holder.uPostCode = (TextView) convertView.findViewById(R.id.postCode);
// holder.UDateTime = (TextView) convertView.findViewById(R.id.dateTimeView);
// Bind the data efficiently with the holder.
convertView.setTag(holder);
} else {
// Get the ViewHolder back to get fast access to the TextView
// and the ImageView.
holder = (ViewHolder) convertView.getTag();
}
// If weren't re-ordering this you could rely on what you set last time
// holder.text.setText(filteredData.get(position));
holder.uName.setText(filteredData.get(position));
// holder.uPostCode.setText(filteredData.get(position));
// holder.UDateTime.setText(filteredData.get(position));
return convertView;
}
static class ViewHolder {
TextView uName;
// TextView uPostCode;
// TextView UDateTime;
}
public Filter getFilter() {
return mFilter;
}
private class ItemFilter extends Filter {
#Override
protected FilterResults performFiltering(CharSequence constraint) {
String filterString = constraint.toString().toLowerCase();
FilterResults results = new FilterResults();
final List<String> list = originalData;
int count = list.size();
final ArrayList<String> nlist = new ArrayList<String>(count);
String filterableString ;
for (int i = 0; i < count; i++) {
filterableString = list.get(i);
if (filterableString.toLowerCase().contains(filterString)) {
nlist.add(filterableString);
}
}
results.values = nlist;
results.count = nlist.size();
return results;
}
#SuppressWarnings("unchecked")
#Override
protected void publishResults(CharSequence constraint, FilterResults results) {
filteredData = (ArrayList<String>) results.values;
notifyDataSetChanged();
}
}
}
Fragment class
public class CompletedJobsFragment extends Fragment {
AppActivity a;
String search;
TableLayout tableLayout;
Vehicle vehicle;
ListView listView;
SearchableAdapter arrayAdapter;
EditText searchInput;
List<String> ListArray = new ArrayList<String>();
ArrayList<ListItem> results = new ArrayList<>();
ListItem repairDetails = new ListItem();
#Nullable
#Override
public View onCreateView(#NonNull LayoutInflater inflater, #Nullable ViewGroup container, #Nullable Bundle savedInstanceState) {
View v= inflater.inflate(R.layout.fragment_completed_jobs,container,false);
a = (AppActivity) getActivity();
assert a != null;
tableLayout = (TableLayout) v.findViewById(R.id.completedJobsTable);
Button clear = v.findViewById(R.id.btnClearTextCarReg);
searchInput = v.findViewById(R.id.txtEditSearchCarReg);
listView = v.findViewById(R.id.list__View);
search = searchInput.getText().toString().trim();
clear.setOnClickListener(av -> searchInput.setText(""));
// Button searchButton = v.findViewById(R.id.btnSearchVehicleReg);
arrayAdapter = new SearchableAdapter(getContext(),ListArray);
listView.setAdapter(arrayAdapter);
listView.setClickable(true);
searchInput.addTextChangedListener(new TextWatcher() {
#Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
#Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
arrayAdapter.getFilter().filter(s);
}
#Override
public void afterTextChanged(Editable s) {
}
});
JobRepository jobRepository = new JobRepository(a.getApplication());
VehicleRepository vehicleRepository = new VehicleRepository(a.getApplication());
jobRepository.findCompleted().observe(getViewLifecycleOwner(), jobs -> {
for (int j = 0; j < jobs.size(); j++) {
if (jobs.get(j).job == null) {
continue;
}
int finalJ = j;
vehicleRepository.findByJob(jobs.get(j).job.getUuid()).observe(getViewLifecycleOwner(), vehicles -> {
for (int vh = 0; vh < vehicles.size(); vh++) {
if (vehicles.get(vh).vehicle == null) {
continue;
}
vehicle = vehicles.get(vh).vehicle;
Job job = jobs.get(finalJ).job;
ListArray.add(jobs.get(finalJ).customer.getName() + job.getPostcode() + job.getDate());
View viewToAdd = arrayAdapter.getView(finalJ, null, null);
TableRow[] tableRows = new TableRow[jobs.size()];
tableRows[finalJ] = new TableRow(a);
tableRows[finalJ].setId(finalJ + 1);
tableRows[finalJ].setPadding(0, 20, 0, 20);
tableRows[finalJ].setBackgroundResource(android.R.drawable.list_selector_background);
tableRows[finalJ].setBackgroundResource(R.drawable.table_outline);
tableRows[finalJ].setLayoutParams(new TableRow.LayoutParams(
TableRow.LayoutParams.MATCH_PARENT,
TableRow.LayoutParams.WRAP_CONTENT
));
tableRows[finalJ].addView(viewToAdd);
tableLayout.addView(tableRows[finalJ], new TableLayout.LayoutParams(
TableLayout.LayoutParams.MATCH_PARENT,
TableLayout.LayoutParams.WRAP_CONTENT
));
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// When clicked, show a toast with the TextView text or do whatever you need.
// Toast.makeText(getContext(), "asd", Toast.LENGTH_SHORT).show();
Bundle bundle = new Bundle();
bundle.putString(JOB_ID, job.getUuid().toString());
bundle.putString(CUSTOMER_NAME, jobs.get(finalJ).customer.getName());
// bundle.putString(JOB_DATE, sdf.format(job.getDate()));
Fragment fragment = new ViewCustomerInformationFragment();
fragment.setArguments(bundle);
FragmentTransaction transaction = requireActivity().getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, fragment);
transaction.addToBackStack(null);
// Commit the transaction
transaction.commit();
}
});
}
});
}
});
return v;
}
Fragment xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/imageViewBGhm"
android:scaleType="center"
android:orientation="vertical"
android:background="#color/white">
<TextView
android:id="#+id/txtTitle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="20dp"
android:layout_marginTop="80dp"
android:layout_marginEnd="180dp"
android:text="#string/completed_jobs"
android:textColor="#color/ddGrey"
android:textSize="28sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.375"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<EditText
android:id="#+id/txtEditSearchCarReg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txtTitle2"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:ems="12"
android:inputType="textPersonName"
android:paddingStart="5dp"
android:paddingEnd="10dp"
android:paddingBottom="22dp"
android:textAlignment="textStart"
android:textSize="18sp" />
<TableRow
android:id="#+id/tableTitleRow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txtEditSearchCarReg"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="20dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="6dp"
android:background="#color/lightGrey"
android:divider="?android:attr/dividerHorizontal"
android:showDividers="middle"
android:visibility="visible">
<TextView
android:id="#+id/txtCustomerNameTitle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="4sp"
android:layout_marginTop="10dp"
android:layout_marginEnd="4sp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:gravity="center"
android:text="#string/customer_name_hc"
android:textColor="#color/black"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtPostcodeTitle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:gravity="center"
android:text="#string/postcode_placeholder"
android:textColor="#color/black"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtDateTitle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:gravity="center"
android:text="#string/date"
android:textColor="#color/black"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtTimeTitle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginEnd="20sp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:gravity="center"
android:text="#string/enquiry_vat_value"
android:textColor="#color/black"
android:textSize="18sp"
android:textStyle="bold" />
</TableRow>
<ListView
android:id="#+id/list__View"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="#id/tableTitleRow"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:visibility="visible" />
<TableLayout
android:id="#+id/completedJobsTable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txtEditSearchCarReg"
android:layout_marginStart="2dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="2dp"
android:layout_marginBottom="2dp"
android:stretchColumns="0,1,2"
android:visibility="gone">
</TableLayout>
<Button
android:id="#+id/btnClearTextCarReg"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_alignTop="#+id/txtEditSearchCarReg"
android:layout_alignParentEnd="true"
android:layout_marginStart="175dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="20dp"
android:background="#drawable/ic_outline_cancel_24"
android:backgroundTint="#color/ddOrange"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground" />
<Button
android:id="#+id/btnSearchVehicleReg"
style="#style/DDButtons"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="#+id/txtEditSearchCarReg"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="14dp"
android:background="#drawable/custom_buttons"
android:drawableStart="#drawable/ic_outline_search_24"
android:drawablePadding="12dp"
android:letterSpacing="0.2"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:singleLine="true"
android:text="#string/search_postcode"
android:textAlignment="textStart"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone"/>
</RelativeLayout>

my ListView is not showing my image

I have to make a listview from database and i want to put a image that is clickable in my list.I use CursorAdapter for it,but my image does not show on my list.Here is my BooksCursorAdapter
public class BooksCursorAdapter extends CursorAdapter {
public BooksCursorAdapter(Context context, Cursor c) {
super(context, c, 0 );
}
#Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
return LayoutInflater.from(context).inflate(R.layout.books_list_item, parent, false);
}
#Override
public void bindView(View view,final Context context, Cursor cursor) {
TextView productText = view.findViewById(R.id.productText);
TextView priceText = view.findViewById(R.id.priceText);
TextView quantityText = view.findViewById(R.id.quantityText);
ImageView shopButton = view.findViewById(R.id.shop_button);
int productColumnIndex = cursor.getColumnIndex(BooksContract.BooksEntry.COLUMN_BOOKS_PRODUCT);
int priceColumnIndex = cursor.getColumnIndex(BooksContract.BooksEntry.COLUMN_BOOKS_PRICE);
final int quantityColumnIndex = cursor.getColumnIndex(BooksContract.BooksEntry.COLUMN_BOOKS_QUANTITY);
String bookProduct = cursor.getString(productColumnIndex);
String bookPrice = cursor.getString(priceColumnIndex);
final int bookQuantity = cursor.getInt(quantityColumnIndex);
productText.setText(bookProduct);
priceText.setText(bookPrice);
quantityText.setText(Integer.toString(bookQuantity));
int idColumnIndex = cursor.getColumnIndex(BooksContract.BooksEntry._ID);
final int booksId = cursor.getInt(idColumnIndex);
shopButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Uri currentUri = ContentUris.withAppendedId(BooksContract.BooksEntry.CONTENT_URI, booksId);
makeSale(context, bookQuantity, currentUri);
}
});
}
private void makeSale(Context context, int bookQuantity, Uri uri) {
if (bookQuantity == 0) {
Toast.makeText(context, R.string.no_books, Toast.LENGTH_SHORT).show();
} else {
int newQuantity = bookQuantity - 1;
ContentValues values = new ContentValues();
values.put(BooksContract.BooksEntry.COLUMN_BOOKS_QUANTITY, newQuantity);
context.getContentResolver().update(uri, values, null, null);
}
}
}
Everything works fine and how it should be only that my image is not showing.
My book_list_item.xml:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="333dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="#dimen/activity_margin">
<TextView
android:id="#+id/productText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:textAppearance="?android:textAppearanceMedium"
android:textColor="#2B3D4D" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/priceText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:textAppearance="?android:textAppearanceSmall"
android:textColor="#AEB6BD"
android:padding="5dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/currencyTextList" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/quantityTextList"
android:padding="5dp"/>
<TextView
android:id="#+id/quantityText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:textAppearance="?android:textAppearanceSmall"
android:textColor="#AEB6BD" />
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="52dp"
android:layout_height="match_parent"
android:src="#drawable/shop_button"
android:id="#+id/shop_button"/>
</LinearLayout>
The image appears in my preview but not on my phone.I want to display an image stored on xml, that I can click on.
I did what #crammeur said, in second LinearLayout i replaced android:layout_width="333dp" with android:layout_width="0dp" and add android:layout_weight="1"

Add Progress bar while data loading from database

I use volley library to get data from database i use this code
public class R_arabic extends AppCompatActivity {
RequestQueue requestQueue;
ListView listView;
ArrayList<listitem_gib> listitems = new ArrayList<listitem_gib>();
String name, img, url, num;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_r_arabic);
listView = (ListView) findViewById(R.id.listView);
TextView textView_Title = (TextView) findViewById(R.id.textView2);
Intent intent = getIntent();
String story_type = intent.getStringExtra("story_type");
switch (story_type) {
case "arabic":
textView_Title.setText("arabic");
break;
case "romance":
textView_Title.setText("romance");
break;
case "motrgm":
textView_Title.setText("motrgm");
break;
case "ro3b":
textView_Title.setText("ro3b");
break;
case "siasa":
textView_Title.setText("siasa");
break;
}
String url = "http://grassyhat.com/android/" + story_type + ".php";
requestQueue = Volley.newRequestQueue(this);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url,
new Response.Listener<JSONObject>() {
public void onResponse(JSONObject response) {
try {
JSONArray jsonArray = response.getJSONArray("all");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject respons = jsonArray.getJSONObject(i);
String id = respons.getString("id");
String name = respons.getString("name");
String img = respons.getString("img");
String url = respons.getString("url");
String num = respons.getString("num");
listitems.add(new listitem_gib(id, name, img, url, num));
}
} catch (JSONException e) {
e.printStackTrace();
}
listAllItme();
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
Log.e("VOLLEY", "ERROR");
}
}
);
requestQueue.add(jsonObjectRequest);
}
public void listAllItme() {
ListAdapter lA = new listAdapter(listitems);
listView.setAdapter(lA);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
CheckInternetConnection cic = new CheckInternetConnection(getApplicationContext());
Boolean Ch = cic.isConnectingToInternet();
if (!Ch) {
Toast.makeText(R_arabic.this, "no connection", Toast.LENGTH_LONG).show();
} else {
Intent open = new Intent(R_arabic.this, rewaya_show.class);
open.putExtra("name", listitems.get(position).name);
open.putExtra("url", listitems.get(position).url);
open.putExtra("img", listitems.get(position).img);
open.putExtra("num", listitems.get(position).num);
startActivity(open);
showad++;
if (showad >= 5) {
showad = 0;
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
}
}
}
});
}
class listAdapter extends BaseAdapter {
ArrayList<listitem_gib> lista = new ArrayList<listitem_gib>();
public listAdapter(ArrayList<listitem_gib> lista) {
this.lista = lista;
}
#Override
public int getCount() {
return lista.size();
}
#Override
public Object getItem(int position) {
return lista.get(position).name;
}
#Override
public long getItemId(int position) {
return position;
}
#Override
public View getView(final int position, View convertView, ViewGroup parent) {
LayoutInflater layoutInflater = getLayoutInflater();
View view = layoutInflater.inflate(R.layout.row_item_gib, null);
TextView name = (TextView) view.findViewById(R.id.textView_gib);
ImageView img = (ImageView) view.findViewById(R.id.imageView_gib);
TextView num = (TextView) view.findViewById(R.id.textView_gib2);
name.setText(lista.get(position).name);
num.setText(lista.get(position).num);
Picasso.with(R_arabic.this).load("http://grassyhat.com/android/image/" + lista.get(position).img).into(img);
return view;
}
}
i want to add progress bar while data loading to avoid blank page
sorry i'm new in android and i google for that and don't get useful answer
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.kamal.ahmed.rewaya.R_arabic"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:background="#drawable/bg"
tools:showIn="#layout/app_bar_r_arabic">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/adView">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="40sp"
android:textStyle="bold"
android:textColor="#e873400c"
android:layout_gravity="center"
android:id="#+id/textView2" />
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/listView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:paddingRight="#dimen/activity_horizontal_margin"
android:divider="#drawable/div1"
android:dividerHeight="35dp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/progress_layout"
android:visibility="gone">
<ProgressBar
android:id="#+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="100dp"
android:layout_marginBottom="60dp"
android:layout_weight="1"/>
<TextView
android:text="Download"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progress_txt"
android:textSize="30sp"
android:textStyle="bold"
android:textColor="#e873400c"
android:layout_gravity="center"
android:layout_marginRight="90dp"
android:layout_marginBottom="60dp"
android:layout_weight="1" />
</LinearLayout>
Add progressBar in your activity_r_arabic
<ProgressBar
android:id="#+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
add ProgessBar progressBar; as global variable in your activity
and initialise it as
progressBar = (ProgessBar) findViewById(R.id.progress_bar);
and then In onResponse(JSONObject response) method add following line
progressBar.setVisibility(View.GONE)
EDIT
Make your linearLayout visible in xml
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/progress_layout"
android:visibility="visible">
<ProgressBar
android:id="#+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="100dp"
android:layout_marginBottom="60dp"
android:layout_weight="1"/>
<TextView
android:text="Download"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progress_txt"
android:textSize="30sp"
android:textStyle="bold"
android:textColor="#e873400c"
android:layout_gravity="center"
android:layout_marginRight="90dp"
android:layout_marginBottom="60dp"
android:layout_weight="1" />
</LinearLayout>
and inside onResponse(JSONObject response) method add following line
progress_layout.setVisibility(View.GONE)

ListView not Appearing

I am trying to make an activity that provides a list of emergency phone numbers with the ability for the user to add their own custom entries and save them. For some reason, the ListView doesn't appear on the activity. I'm pretty sure I'm doing something wrong in the CustomAdapter class that I made to hold two text boxes in each segment of the ListView.
I'm also trying to set the listView to start a phone activity with the phone number of whatever segment was touched, and I'm unsure if I'm doing this correctly.
PhoneList.java :
public class PhoneList extends AppCompatActivity {
ArrayList<String> customList;
ArrayList<String> numList;
Bundle b;
TinyDB tinydb;
CustomAdapter dataAdapter;
ListView phoneListView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_phone_list);
phoneListView = (ListView)findViewById(R.id.listViewPhone);
Integer num = null;
String label = "";
customList = null;
numList = null;
tinydb = new TinyDB(this);
Button saveContact = (Button)(findViewById(R.id.button4));
b = new Bundle();
customList = tinydb.getListString("label");
ArrayList<Integer> temp = tinydb.getListInt("num");
for(int i = 0; i < temp.size(); i++){
numList.add(temp.get(i).toString());
}
saveContact.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
EditText enteredLabel = (EditText)findViewById(R.id.editText2);
EditText enteredNum = (EditText)findViewById(R.id.editText);
String label = enteredLabel.getText().toString();
Integer num = Integer.parseInt(enteredNum.getText().toString());
b.putString("label",label);
b.putInt("num",num);
addPhoneItem();
}
});
ArrayList<String> phoneList = new ArrayList<>();
phoneList.add("Emergencies");
phoneList.add("Travel Info ");
phoneList.add("Poison Control ");
phoneList.add("AAA: 1(800)836-2582");
if(customList != null && customList.size() > 0) phoneList.addAll(customList);
ArrayList<String> numberList = new ArrayList<>();
numberList.add("911");
numberList.add("511");
numberList.add("18002221222");
numberList.add("18008362582");
if(numList != null && numList.size()>0) {
for (int i = 0; i < numList.size(); i++) {
numberList.add(numList.get(i).toString());
}
}
dataAdapter = new CustomAdapter(this,numberList,phoneList);
phoneListView.setAdapter(dataAdapter);
}
public void addPhoneItem(){
customList.add(b.getString("label"));
numList.add(b.getString("num"));
tinydb.putListString("label",customList);
tinydb.putListString("num",numList);
dataAdapter = new CustomAdapter(this,numList,customList);
phoneListView.setAdapter(dataAdapter);
}
private class CustomAdapter extends ArrayAdapter<String> {
ArrayList<String> labels;
ArrayList<String> nums;
Context context;
public CustomAdapter(Context context, ArrayList<String> n,ArrayList<String> l) {
super(context,R.layout.phone_item);
this.context = context;
labels = new ArrayList<String>();
labels.addAll(l);
nums = new ArrayList<String>();
nums.addAll(n);
}
#Override
public View getView(final int position, View convertView, ViewGroup parent) {
try {
ViewHolder holder = null;
if (convertView == null) {
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = vi.inflate(R.layout.phone_item, null);
holder = new ViewHolder();
holder.viewLabel = (TextView) convertView.findViewById(R.id.editText);
holder.viewNumber = (TextView) convertView.findViewById(R.id.editText2);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
String label = labels.get(position);
String num = nums.get(position);
holder.viewLabel.setText(label);
holder.viewNumber.setText(num);
holder.viewNumber.setTag(num);
holder.viewNumber.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
String str = "tel:" + (EditText) v.getTag();
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(str));
try {
startActivity(intent);
} catch (Exception e) {
Toast.makeText(getContext(),"Exception Caught in CustomAdapter",Toast.LENGTH_SHORT).show();
}
}
});
}
catch(Exception e){
Toast.makeText(getContext(),"Exception caught",Toast.LENGTH_SHORT).show();
}
return convertView;
}
}
private class ViewHolder{
TextView viewLabel;
TextView viewNumber;
}
}
activity_phone_list.xml :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res``/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.rvtripapp.dempsey.rvtripapp.PhoneList">
<ListView
android:layout_width="wrap_content"
android:layout_height="400dp"
android:id="#+id/listViewPhone"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:id="#+id/editText"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:editable="true"
android:hint="Label" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="10"
android:id="#+id/editText2"
android:layout_below="#+id/editText"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:hint="Phone Number" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:id="#+id/button4"
android:textSize="40dp"
android:background="#44fe66"
android:layout_alignBottom="#+id/editText2"
android:layout_alignRight="#+id/listView"
android:layout_alignEnd="#+id/listView" />
</RelativeLayout>
phone_item.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="#+id/textView2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="#+id/textView3" />
</LinearLayout>
Any help is much appreciated, thank you.
Change the super keyword line to
super(context,R.layout.phone_item, n);
Have you tried to override the getCount method of the CustomAdapter class ?
#Override
public int getCount() {
return labels.size();
}
You are setting your custom adapter outside onCreate() try to set it inside the onCreate().

Android - Output value of custom listview - Getting errors

Problem: Trying to output the description of the selected listview. My code is below, and I also have an example of what my listview looks like as well as the code that creates it. I have a custom listview that shows three values, when I click the 2nd line (3/12/04 Gas $60.00) I want it to output the description ("Gas").
The onItemClick is where my issue is in ItemMenuActivity.
Thanks for your help and time!
Example Data in listview:
3/12/04 New Shoes $50.00
3/12/04 Gas $60.00
3/12/04 Food $10.00
ItemMenuActivity.java
public class ItemMenuActivity extends Activity implements AdapterView.OnItemClickListener
{
String accountName;
ArrayList<Item> item_details;
DatabaseHandler database;
ListView itemView;
private EditText dateEditText, costEditText, desEditText;
private Spinner categorySpinner;
private Button btnAddItem, btnCancel;
private boolean errlvl;
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.item_menu_layout);
// Initiate Database
database = new DatabaseHandler(getApplicationContext());
// Initiate/configure ListView
itemView = (ListView)findViewById(R.id.itemListView);
itemView.setOnItemClickListener(this);
Bundle bundle = getIntent().getExtras();
String account_name = bundle.getString("AccountName");
setTitle(account_name);
accountName = account_name;
displaySpecificItemListView(accountName);
}
#Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
//TextView editTextDescription = ((TextView)view.findViewById(R.id.editTextDescription));
//String temp = editTextDescription.getText().toString();
//Toast.makeText(this, temp, Toast.LENGTH_LONG).show();
}
}
add_item_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/addItemLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="10dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/textViewDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="#string/purchDateTitle"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<EditText
android:id="#+id/editTextDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="#+id/editTextDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:hint="Enter Item Description"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$ "
android:textSize="20dp"/>
<EditText
android:id="#+id/editTextCost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:hint="Enter Total Cost"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Spinner
android:id="#+id/categorySelectSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="horizontal">
<Button
android:id="#+id/btnAddItem"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Add" />
<Button
android:id="#+id/btnCancelItem"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Cancel" />
</LinearLayout>
</LinearLayout>
ItemListViewBaseAdapter.java
public class ItemListViewBaseAdapter extends BaseAdapter
{
private ArrayList<Item> _data;
Context _c;
ItemListViewBaseAdapter (ArrayList<Item> data, Context c)
{
_data = data;
_c = c;
}
public int getCount()
{
// TODO Auto generated method stub
return _data.size();
}
public Object getItem(int position)
{
// TODO Auto generated method stub
return _data.get(position);
}
public long getItemId(int position)
{
// TODO Auto generated method stub
return position;
}
public View getView (int position, View convertView, ViewGroup parent)
{
// TODO Auto generate method stub
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater)_c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.custom_item_listview_layout, null);
}
TextView itemDate = (TextView)v.findViewById(R.id.dateTextView);
TextView itemDescription = (TextView)v.findViewById(R.id.descriptionTextView);
TextView itemAmount = (TextView)v.findViewById(R.id.amountTextView);
Item accMsg = _data.get(position);
itemDate.setText(accMsg.entry_date);
itemDescription.setText(accMsg.item_description);
//NumberFormat format
if(accMsg.item_price > 0)
{
String myString = String.format("%.2f", accMsg.item_price);
String FormattedString = "$"+myString;
itemAmount.setText(FormattedString);
}
else
{
double temp = Math.abs(accMsg.item_price);
String myString = String.format("%.2f", temp);
String FormattedString = "-$"+myString;
itemAmount.setText(FormattedString);
itemAmount.setTextColor(Color.parseColor("#088A08"));
}
return v;
}
}
item_menu_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="#+id/itemListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:dividerHeight="0.1dp"
android:divider="#81A594"
android:layout_below="#+id/dateTitle"/>
</RelativeLayout>
In your onItemClick() method you're doing
TextView editTextDescription = ((TextView)view.findViewById(R.id.editTextDescription));
to get your TextView. This matches the XML you posted (add_item_layout.xml), but your adapter code tells a different story.
In your adapter, for new rows you are inflating custom_item_listview_layout and your "description" TextView ID is R.id.descriptionTextView.
So if you make this edit in onItemClick(), it should solve your problem:
TextView editTextDescription = ((TextView)view.findViewById(R.id.descriptionTextView));

Categories