'Cannot resolve method 'from' in 'View'

@NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view; switch (viewType){ case 0: view = LayoutInflater.from(parent.getContext()).inflate(R.layout.user_msg_rv_item,parent,false); return new UserViewHolder(view);

        case 1:
            view = LayoutInflater.from(parent.getContext()).inflate(R.layout.bot_msg_rv_item,parent,false);
            return new BotVeiwHolder(view);
    }
    return null;
}

.fr



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source