Function being called twice in runOnUiThread Android Studio java

202 Views Asked by At

I have a JavascriptInterface that calls a function to draw in a layout. This function needs to be run on the UI Thread. I don't know why, but it is always called twice, making my app fail. Can someone help me?

@JavascriptInterface
        public void cambiarIdioma(String idIdioma)
        {
            runOnUiThread(new Runnable()
            {
                @Override
                public void run()
                {
                    setupTabLayout(Integer.parseInt(idIdioma),false);
                }
            });
        }
0

There are 0 best solutions below