1. Are you ready for the Galaxy S20? Here is everything we know so far!

Fatal Exception: java.lang.IllegalArgumentException width and height must be > 0 on Chromecast imple

Discussion in 'Android Development' started by Ashish87, Nov 6, 2020.

  1. Ashish87

    Ashish87 Lurker
    Thread Starter

    I am trying to implement Chromecast functionality using casty sdk.

    Ref: https://github.com/DroidsOnRoids/Casty

    But always getting

    Fatal Exception: java.lang.IllegalArgumentException width and height must be > 0

    android.view.View.draw (View.java:21594)

    Below is my code

    //Oncreate()
    casty = Casty.create(this)
    .withMiniController();

    casty.setOnConnectChangeListener(new Casty.OnConnectChangeListener() {
    @override
    public void onConnected() {
    Util.showToast(getApplicationContext(), "Connected");
    casty.getPlayer().loadMediaAndPlay(createSampleMediaData()...);
    }

    @override
    public void onDisconnected() {
    Util.showToast(getApplicationContext(), "Disconnected");
    }
    });

    //Menu
    @override
    public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    casty.addMediaRouteMenuItem(menu);
    getMenuInflater().inflate(R.menu.browse, menu);
    return true;
    }

    So how can we solve it any idea? Did anyone face it?
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...

Share This Page

Loading...