yatogami | Chat library
kandi X-RAY | yatogami Summary
kandi X-RAY | yatogami Summary
yatogami
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of yatogami
yatogami Key Features
yatogami Examples and Code Snippets
Community Discussions
Trending Discussions on yatogami
QUESTION
Im new in java/android, im trying make fragment activity and implement adapter into my fragment 'tab2' but getting eror code in line(adapter.java) :
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
im already trying to fix. but still cant resolve this. So, what is wrong in my code? this my full code adapter.java :`
...ANSWER
Answered 2017-May-25 at 13:42Fragment
does not extend Context
that is why you cannot call getSystemService
. Instead of passing the fragment instance, pass the context from the fragment's host activity. It is advisable to instantiate the Adapter in Fragment.onAttach()
since you are sure that the context is valid. And also, use
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install yatogami
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page