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

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?