GithubHelp home page GithubHelp logo

Comments (6)

andriipanasiuk avatar andriipanasiuk commented on June 14, 2024

Hello, @dmapr. Thank you create the issue.
It's reproduced on my side as well.
Working on that.

from android-repository.

andriipanasiuk avatar andriipanasiuk commented on June 14, 2024

BTW, could you please send me your stacktrace after crash so we can compare it with mine.
I have the following:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.onFinishInflate()' on a null object reference
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:826)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
     at android.databinding.DataBindingUtil.inflate(DataBindingUtil.java:116)
     at com.jivesoftware.rnd.smartlingmdn.databinding.ItemBinding.inflate(ItemBinding.java:127)
     at com.jivesoftware.rnd.smartlingmdn.databinding.ItemBinding.inflate(ItemBinding.java:124)
     at com.jivesoftware.rnd.smartlingmdn.MainActivity$TextRecyclerAdapter.onCreateViewHolder(MainActivity.java:61)
     at com.jivesoftware.rnd.smartlingmdn.MainActivity$TextRecyclerAdapter.onCreateViewHolder(MainActivity.java:56)
     at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6367)
     at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5555)
...

Thus, it seems the usage of databinding approach causes this issue. Anyway, I'm working on that. Just want to know how does your stacktrace look like. And also do you still have this issue if you remove these lines from your code:

 contents.add(new Content(Content.TextType.Rich,
                "<html><body>" +
                        "<h1>Movies</h1>" +
                        "<li>A Fistful of Dollars</li>" +
                        "<li>For a Few Dollars More</li>" +
                        "<li>The Good, the Bad and The Ugly</li>" +
                        "</ol>" +
                        "</body></html>"));

so that WebView doesn't appear on the screen.
Thanks.

from android-repository.

andriipanasiuk avatar andriipanasiuk commented on June 14, 2024

Okay, now I see - Data Binding doesn't cause this issue itself. Smartling SDK is compatible with Data Binding approach.
The reason is WebView is presented in the layout file.

from android-repository.

dmapr avatar dmapr commented on June 14, 2024

@andriipanasiuk -- you're correct, the databinding has nothing to do with it. In the real app we have a crash with a dynamically created view that inflates its own layout (containing the WebView) from an XML file using LayoutInflater.from(context).inflate(R.layout...) call. Here's the relevant portion of the stack trace in that case:

03-24 11:12:42.610 E/AndroidRuntime(12103): android.view.InflateException: Binary XML file line #6: Attempt to invoke virtual method 'android.content.Context android.view.View.getContext()' on a null object reference
03-24 11:12:42.610 E/AndroidRuntime(12103): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.view.View.getContext()' on a null object reference
03-24 11:12:42.610 E/AndroidRuntime(12103): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
03-24 11:12:42.610 E/AndroidRuntime(12103): at android.view.LayoutInflater.rInflate(LayoutInflater.java:861)
03-24 11:12:42.610 E/AndroidRuntime(12103): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
03-24 11:12:42.610 E/AndroidRuntime(12103): at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
03-24 11:12:42.610 E/AndroidRuntime(12103): at android.view.LayoutInflater.inflate(LayoutInflater.java:377)

I have also tried to use the fully qualified name of the WebView class (android.webkit.WebView) but that made no difference.

from android-repository.

andriipanasiuk avatar andriipanasiuk commented on June 14, 2024

Please use the latest 2.3.2 version to fix this issue.

from android-repository.

dmapr avatar dmapr commented on June 14, 2024

Thank you! 2.3.2 works like a charm.

from android-repository.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.