Skip to main content

Android 4.0: canvas.setViewport error



I'm getting an error in my code. the method setViewPort(int, int) cannot be defined for the type canvas.





I am trying to implement multi touch functionality on an ImageView, the intire class is far too long to put up here but if you require more information just comment.







@Override

protected void onDraw(Canvas canvas) {

if(layout) {

if(!viewSet) {

//line that's causing issue

canvas.setViewport(displayWidth, displayHeight);

viewSet = true;

}







can't figure out what the issue is, have all necessary imports etc.





Would it be the fact I'm using Android 4.0?





thanks.





Shaw


Comments

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.