0

I want to know how to show an image which is in my case a gif loading screen to show when opening the layout of web view to give it time to give time to load contents in web view. Either i should use a timer for the image to load or anything else.

new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            Intent i = new Intent(net_fragment_1.this,loadinganimate.class);
            startActivity(i);
            finish();
        }
    },1000);

I have tried this code but it is crashing. Note- i am keeping loadinganimate class in the same package.

But whenver i am keeeping in different package and calling it by full path like com.xyz.xyz.loadinganimate.class it is just showing this class and not resuming to the original windows after a period of time...

PRAJ
  • 33
  • 7

1 Answers1

0

remove handler and add these lines in to your code

if (webView.isShown()){
            loadinganimate.setVisibility(View.INVISIBLE);
        }
Farhan Fahim
  • 137
  • 2
  • 7