• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

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

Ashish87

Lurker
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?
 
Back
Top Bottom