When I use UserListAdapter I got a line on “View” word and an error in “parent ”
up vote
0
down vote
favorite
When I use UserListAdapter
I got a line on View
word and an error in "parent":
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x) {
View LayoutView = LayoutInflater.from(Parent.getContext).inflate
(R.layout.item_user , null , false);
java android whatsapp
New contributor
add a comment |
up vote
0
down vote
favorite
When I use UserListAdapter
I got a line on View
word and an error in "parent":
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x) {
View LayoutView = LayoutInflater.from(Parent.getContext).inflate
(R.layout.item_user , null , false);
java android whatsapp
New contributor
can you explain your problem little more??. what you want exactly
– Vishal Sharma
Nov 10 at 13:12
Is this a RecyclerView Adapter ?
– Rohit Singh
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
When I use UserListAdapter
I got a line on View
word and an error in "parent":
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x) {
View LayoutView = LayoutInflater.from(Parent.getContext).inflate
(R.layout.item_user , null , false);
java android whatsapp
New contributor
When I use UserListAdapter
I got a line on View
word and an error in "parent":
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x) {
View LayoutView = LayoutInflater.from(Parent.getContext).inflate
(R.layout.item_user , null , false);
java android whatsapp
java android whatsapp
New contributor
New contributor
edited Nov 10 at 18:14
Pushpesh Kumar Rajwanshi
2,2371718
2,2371718
New contributor
asked Nov 10 at 11:16
Mohsen Ahmed
6
6
New contributor
New contributor
can you explain your problem little more??. what you want exactly
– Vishal Sharma
Nov 10 at 13:12
Is this a RecyclerView Adapter ?
– Rohit Singh
yesterday
add a comment |
can you explain your problem little more??. what you want exactly
– Vishal Sharma
Nov 10 at 13:12
Is this a RecyclerView Adapter ?
– Rohit Singh
yesterday
can you explain your problem little more??. what you want exactly
– Vishal Sharma
Nov 10 at 13:12
can you explain your problem little more??. what you want exactly
– Vishal Sharma
Nov 10 at 13:12
Is this a RecyclerView Adapter ?
– Rohit Singh
yesterday
Is this a RecyclerView Adapter ?
– Rohit Singh
yesterday
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
getContext
looks like a function ... so I guess your code line should be
View LayoutView = LayoutInflater.from(Parent.getContext()).inflate()
after getContext
is missing in your version ...
add a comment |
up vote
0
down vote
You can get context from viewGroup that is parent to your item. Use below code as you are doing it wrong.
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x)
View LayoutView = LayoutInflater.from(viewGroup.getContext()).inflate
(R.layout.item_user , null , false);
//Rest of your code.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
getContext
looks like a function ... so I guess your code line should be
View LayoutView = LayoutInflater.from(Parent.getContext()).inflate()
after getContext
is missing in your version ...
add a comment |
up vote
0
down vote
getContext
looks like a function ... so I guess your code line should be
View LayoutView = LayoutInflater.from(Parent.getContext()).inflate()
after getContext
is missing in your version ...
add a comment |
up vote
0
down vote
up vote
0
down vote
getContext
looks like a function ... so I guess your code line should be
View LayoutView = LayoutInflater.from(Parent.getContext()).inflate()
after getContext
is missing in your version ...
getContext
looks like a function ... so I guess your code line should be
View LayoutView = LayoutInflater.from(Parent.getContext()).inflate()
after getContext
is missing in your version ...
edited yesterday
Rohit Singh
2,18812030
2,18812030
answered yesterday
PrfctByDsgn
78211011
78211011
add a comment |
add a comment |
up vote
0
down vote
You can get context from viewGroup that is parent to your item. Use below code as you are doing it wrong.
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x)
View LayoutView = LayoutInflater.from(viewGroup.getContext()).inflate
(R.layout.item_user , null , false);
//Rest of your code.
add a comment |
up vote
0
down vote
You can get context from viewGroup that is parent to your item. Use below code as you are doing it wrong.
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x)
View LayoutView = LayoutInflater.from(viewGroup.getContext()).inflate
(R.layout.item_user , null , false);
//Rest of your code.
add a comment |
up vote
0
down vote
up vote
0
down vote
You can get context from viewGroup that is parent to your item. Use below code as you are doing it wrong.
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x)
View LayoutView = LayoutInflater.from(viewGroup.getContext()).inflate
(R.layout.item_user , null , false);
//Rest of your code.
You can get context from viewGroup that is parent to your item. Use below code as you are doing it wrong.
public UserListViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int x)
View LayoutView = LayoutInflater.from(viewGroup.getContext()).inflate
(R.layout.item_user , null , false);
//Rest of your code.
answered yesterday
Karan Mer
3,24532662
3,24532662
add a comment |
add a comment |
Mohsen Ahmed is a new contributor. Be nice, and check out our Code of Conduct.
Mohsen Ahmed is a new contributor. Be nice, and check out our Code of Conduct.
Mohsen Ahmed is a new contributor. Be nice, and check out our Code of Conduct.
Mohsen Ahmed is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238404%2fwhen-i-use-userlistadapter-i-got-a-line-on-view-word-and-an-error-in-parent%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
can you explain your problem little more??. what you want exactly
– Vishal Sharma
Nov 10 at 13:12
Is this a RecyclerView Adapter ?
– Rohit Singh
yesterday