Hi all,
This is going to be very simple but I'm still trying to get the hand
of how classes and Activities etc tie together in java.
I am using the Lunar Lander code as a base for a simple application.
It has the main class and a gameview class to handle all the drawing
etc.
I have looked in the SDK for code to vibrate the phone and I found
this:
Java:
Vibrator vibrator = (Vibrator)getSystemService
(Context.VIBRATOR_SERVICE);
vibrator.vibrate(500);
If I put that code in the OnCreate within the main class it works
fine.
However, if I put this same code in the gameview class the
getSystemService highlights as an error with the following message:
The method getSystemService(String) is undefined for the type
GameView.GameThread
I have had this same error with a couple of things I have tried to
play with. How do I use the the getSystemService from the GameView
Class?
Thanks in advance.
Matt.
PS. If i'm being really stupid and this is very simple, please help
anyway preferably with an explanation, I don't mind being made to look
stupid as long as I can get it working! Razz
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---