Click here to Skip to main content
15,309,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am loading fragment into my activity. where i am using listview in my fragment

public class NewTask : Fragment {

public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
//var textToDisplay = new StringBuilder().Insert(0, "The quick brown fox jumps over the lazy dog. ", 450).ToString();
var view = inflater.Inflate(Resource.Layout.NewTask1, container, false);
..........

_adapter =new CustomAdapter(this, tableItems);

}

here is my adapter:

public class CustomAdapter : BaseAdapter { public override View GetView(int position, View convertView, ViewGroup parent) {

var view = convertView ?? _context.LayoutInflater.Inflate(Resource.Layout.CustomTable, null);

var chemical = _items[position];
{
}

I am facing the issue here where am loading fragment into activity and i dont know how to use inflate to get my custom view in the adapter.

as you can see _context is fragment instance.

please give solution.thanks in advance
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900