Used this in a Fragment, but getting an error while casting inflater - please help
See original GitHub issueplease check my coding for this
ProteusLayoutInflater layoutInflater = (ProteusLayoutInflater)inflater;
ProteusView view = layoutInflater.inflate(jsonlayout.toString(), null, container, 0);
return view.getAsView();
i want to use library send json object and create a view and render it as a fragment. can you please help what i did wrong? for the coding im getting the following error
com.android.internal.policy.PhoneLayoutInflater cannot be cast to com.flipkart.android.proteus.ProteusLayoutInflater
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Used Proteus in an Android Fragment, but getting an error ...
I want to use the Proteus library to create a view and render it as a fragment. Can you please tell me what...
Read more >Fragment cast error (Example) | Treehouse Community
Hi , in Fragment Course I get some error in displaying the list and the error I get in this line OnRecipeSelectedInterface listener...
Read more >Fragment | Android Developers
A Fragment is closely tied to the Activity it is in, and can not be used ... Gets whether you should show UI...
Read more >Applying Data Binding for Views | CodePath Android Cliffnotes
If you see an error message such as cannot resolve symbol 'ActivityMainBinding' then this means that the data binding auto-generated class has not...
Read more >Android Passing Data Between Fragments | DigitalOcean
The displayReceivedData() would be called on the instance of FragmentTwo.java from inside the Custom Interface's method inside the MainActivity.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Urge you post your questions on StackOverflow using the proteus tag.
It might be that the following lines are the cause of the exception:
Without looking a more code, it is hard to answer your question.
inflater
?ProteusBuilder
?layoutInflater.inflate()
is aLayout
not aString
. Why?Please check out the readme for a correct usage and please post the question in SO and I will be to happy to help. 😄
Answered here