In this Android WorldClub tutorial i will show you how to create a custom listview in android studio. I will also implement on item click on listview.
#AndroidWorldClub #customlistview
PLEASE LIKE, SUBSCRIBE, COMMENT, SHARE AND PRESS BELL ICON FOR LATEST VIDEOS
Blog:
fb page:
Source Code Link:
Music License:
ZAYFALL – The Origins (Official Music) by ZAYFALL
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Music promoted by Audio Library
Nguồn:https://u-os.org/
Xem Thêm Bài Viết Khác:https://u-os.org/cong-nghe
First of all, thank you a lot, but I was wondering how save one of this row in Sharedpreference to keep it even if you close the app or something
awesome man!!
When i write postion ==1 it shows a message condition position==1 is always false ?? Any solutions
Not working for me here's the code in a picture https://5.top4top.net/p_1453yayx30.jpg
Get layout inflater problem any solutions??
such agreat channel
MyAdapter gave me error on compilation.The error message is error: code too largePlease sir tell me what to do?This is the code I used in MyAdapter class which is assumed to being hardcoded!if (modellist.get(i).getTitle().equals("Song 901 | ")) {
//start NewActivity with title for actionbar and text for textview
Intent intent = new Intent(mContext, NewActivity.class);
intent.putExtra("actionBarTitle", "song Wordings 745");
intent.putExtra("position", 901); //locating the audio files in raw folder
intent.putExtra("contentTv", "This is my song words or lyrics for song 901");
mContext.startActivity(intent);
}
Shortcut key for /! – – so our layout is set – – / still using
thank, i learn a lot of things from you. But you forget to change 0 in the if(position==0) to other number.
Sir where did u get the title on the super (c,R.layout.row,R.id.textView1,title); ? tnx
Thanks man, you saved my life
I already have the return of php, but i was stuck in the customize in the list view
Now I get it, thanks
I had so much trouble trying this until i found your vid… it helped me a lot thank you sir!
GetapplictionContext() error aa rha hai
Bro you are awesome
Sir, my problem is when I make search filter, the position of the string (for example, there is one row result, in the filter, but.. String in position 0 Stays in its original position 0 .. after the filter..) please reply, if you know what i mean.. I need to finish my project ASAP.
Thanks Man..You are SuperHero..
your videos helped me a lot. thanks brother
doesn't appear list view items, no errors 🙁
i only need image
ListView listView;
int images[] = {R.drawable.supermercadoyalmacen,R.drawable.verduleria};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lA);
listView = findViewById(R.id.listviewM);
MyAdapter adapter = new MyAdapter(this, images);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position == 0)
{
Intent intent = new Intent(LA.this, CategoriaActivity.class);
startActivity(intent);
}
if (position == 1)
{
Intent intent = new Intent(LA.this, CategoriaActivity.class);
startActivity(intent);
}
}
});
}
class MyAdapter extends ArrayAdapter<String>
{
Context context;
int rImgs[];
MyAdapter(Context c,int imgs[])
{
super(c, R.layout.row_data);
this.context = c;
this.rImgs = imgs;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
LayoutInflater layoutInflater = (LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View row = layoutInflater.inflate(R.layout.row_data, parent, false);
ImageView images = row.findViewById(R.id.nonoimages);
images.setImageResource(rImgs[position]);
return row;
}
}
I added a background xml file (which was just a rectangle with rounded corners) to the row.xml file and although it shows it it only has rounded corners on the right side. Also how can i add padding between the list view rows?
awesome video! I've been following you for a while now, and I Was wondering, how can I change the images dynamically? and adding more items with different icons dynamically?
hi
thanks for the tutorial, i did it and it worked for me but i am trying to have two items for each row.So if i have 8 items i wish i could show them on just 4 rows. I tried to do it by adding another Layout in row.xml to have two items on a row and after that i linked it with another properties with a findviewById in the xml as we did with another one.
now it works i have two items by row but it is just showing the samething on the same row.
I wish someone could have solution for me thanks
I use a Button to navigate from one activity to another but with this, it just keeps crashing! I've checked everything and have no idea what the problem can be.
nice tutorial
This code is not working properly, I have tried it 5 times. I receive a blank output.
the toast messages for setOnItemClickListener doesn't show up when you click on the items.
bhai live tv app banyo list view laga kr or firebase sa control ke jaya possabile hai asea
Nice job. Thanks bro
Ha Ha ! it still takes 20 minutes to build custom list view , In flutter , it can be built in 5 minutes or less 🙂 Try Switching
For some reason the only thing that pops up for me is the image… Any idéa what it can be?
Can you tell me how can I make it scrollable
Nice video man this will come in handy
How do you do this within a fragment?
Great video but I was wondering if you could show us how to connect these list views with firebase so they can be changed within the application itself. For example the user uploads an image and text which is then displayed in the list view. Im creating my own app and really need your help! Thankyou sir
Thanks, do you please share your code?
anyone have an approach for onclick listener for multiple listview
It gave me 2 errors; one with the: layoutinflater(r.layout.row, parent, false)
And 2nd one in with new Myadapter(this,…,….,…)
Does anyone know the solution?
hey sir please answare how to remove that text CostumListView
hey sir how can i move to another activity from that list 1 by 1 tq
Hello )))
nice video 💗😍
if i click the image will a be able to open a new activity?
keep it up
well done babu…. thodi awaj lga dete to achha hota
Nice Explanation well done