a simple(?) vibration question

Put your problem here if it does not fit any of the other categories.

a simple(?) vibration question

Postby androidonkey » Sat Mar 08, 2008 7:23 pm

Hi All,

I wrote out a small vibration class using the M5 sdk but it doesn't seem to work (no errors received, either). Any tips would be greatly appreciated:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class vibration extends Activity {
  2.  
  3.  
  4.  
  5.     Button BtnVibrate;
  6.  
  7.     Vibrator p1 = new Vibrator();
  8.  
  9.  
  10.  
  11.     @Override
  12.  
  13.     public void onCreate(Bundle icicle) {
  14.  
  15.         super.onCreate(icicle);
  16.  
  17.         setContentView(R.layout.main);
  18.  
  19.        
  20.  
  21.         BtnVibrate = (Button) findViewById(R.id.ButtonVibrate);
  22.  
  23.         BtnVibrate.setOnClickListener(ListenerSubmitProfile);
  24.  
  25.     }
  26.  
  27.    
  28.  
  29.     private OnClickListener ListenerSubmitProfile = new OnClickListener()
  30.  
  31.     {
  32.  
  33.         public void onClick(View v)
  34.  
  35.         {
  36.  
  37.                 p1.vibrate(100000);
  38.  
  39.         }
  40.  
  41.     };
  42.  
  43. }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
androidonkey
Junior Developer
Junior Developer
 
Posts: 13
Joined: Mon Feb 18, 2008 10:20 am

Top

Postby plusminus » Sun Mar 09, 2008 1:33 pm

Hello androiddonkey,

the function you are using is not documented, so it does not have to work :roll:

Maybe have a look at this post: http://www.anddev.org/viewtopic.php?p=3396#3396

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby androidonkey » Sun Mar 09, 2008 1:41 pm

+/-,

I'll try out your example. Thanks for the tip.

- androidonkey
androidonkey
Junior Developer
Junior Developer
 
Posts: 13
Joined: Mon Feb 18, 2008 10:20 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 9 guests