Unregistered
sir i have build the ListView and the code runs succesful as below. now how can i add a Toast so that whenever i click a course its summary should either display or a link page to that course opens

 Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

ListView myListView = (ListView)findViewById(R.id.myListViews);

ArrayList<String>courseslist = new ArrayList<String>();
courseslist.add("CERTIFICATE IN COMPUTER");
courseslist.add("DIPLOMA IN COMPUTER");
courseslist.add("CCNA");
courseslist.add("COMPUTER ENGINEERING");
courseslist.add("SPSS");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");
courseslist.add("PEACTHREE ACCOUNTING");



ArrayAdapter<String>arrayAdapter = new
ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,courseslist);
myListView.setAdapter(arrayAdapter);



FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
Quote 0 0
muhammadzeeshanali
Dear,
To display the toast of list item you clicked you have to add an onItemClickListener and there you can make a toast to do this. Listen the lecture of ListVew again it will surely solve your problem.

Regards,

Muhammad Zeeshan Ali
Quote 0 0

Add a Website Forum to your website.

 
Urdu IT Accademy � 2013 | License Agreement