Первый просмотр с раздувом, затем инициализация
попробуйте этот код:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
// View view= inflater.inflate(R.layout.fragment_home_page, container, false);
View v = getActivity().getLayoutInflater().inflate(R.layout.fragment_home_page,null);
listView=v.findViewById(R.id.listview);
final HomePageListAdapter homePageListAdapter=new HomePageListAdapter(container.getContext(),productName,sku,type,profile,getLayoutInflater());
listView.setAdapter(homePageListAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(getContext(),productName[position],Toast.LENGTH_SHORT).show();
}
});
return v;
}