Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:06:54+00:00 2026-06-16T04:06:54+00:00

That context=this makes my applications stop working. What’s wrong? package com.robot.soccer.control; import com.robot.soccer.control.R; import

  • 0

That context=this makes my applications stop working. What’s wrong?

package com.robot.soccer.control;
import com.robot.soccer.control.R;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Vibrator;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;


public class Main extends Activity implements OnClickListener, AccelerometerListener {

TextView ipText;
 TextView portText;
 TextView status;
 TextView xStatus;
 TextView yStatus;
 TextView zStatus;
 TextView accText;

 ImageButton goBut;
 ImageButton kickBut;
 public float xVal;
 public float yVal;

private static Context CONTEXT;
    @Override
 public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        accText=(TextView)this.findViewById(R.id.accm);
        xStatus=(TextView)this.findViewById(R.id.x);
        yStatus=(TextView)this.findViewById(R.id.y);
        zStatus=(TextView)this.findViewById(R.id.z);
        status=(TextView)this.findViewById(R.id.status);
        portText = (TextView)this.findViewById(R.id.portText);
        ipText=(TextView)this.findViewById(R.id.ipText);
        goBut=(ImageButton)this.findViewById(R.id.goBut);
        kickBut=(ImageButton)this.findViewById(R.id.kickBut);
        goBut.setOnClickListener(this);
        kickBut.setOnClickListener(this);
        accText.setText("AccelerometerStatus ");
        //CONTEXT=this;

    }

Here’s my logcat:

12-20 01:22:50.271: E/AndroidRuntime(281): FATAL EXCEPTION: main
12-20 01:22:50.271: E/AndroidRuntime(281): java.lang.SecurityException: Requires VIBRATE permission
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.os.Parcel.readException(Parcel.java:1247)
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.os.Parcel.readException(Parcel.java:1235)
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.os.IVibratorService$Stub$Proxy.vibrate(IVibratorService.java:106)
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.os.Vibrator.vibrate(Vibrator.java:44)
12-20 01:22:50.271: E/AndroidRuntime(281):  at com.robot.soccer.control.Main.vibrate(Main.java:253)
12-20 01:22:50.271: E/AndroidRuntime(281):  at com.robot.soccer.control.Main.OnAccelerationChanged(Main.java:239)
12-20 01:22:50.271: E/AndroidRuntime(281):  at com.robot.soccer.control.AccelerometerManager$1.onSensorChanged(AccelerometerManager.java:135)
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.hardware.SensorManager$ListenerDelegate$1.handleMessage(SensorManager.java:449)
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.os.Looper.loop(Looper.java:123)
12-20 01:22:50.271: E/AndroidRuntime(281):  at android.app.ActivityThread.main(ActivityThread.java:4627)
12-20 01:22:50.271: E/AndroidRuntime(281):  at java.lang.reflect.Method.invokeNative(Native Method)
12-20 01:22:50.271: E/AndroidRuntime(281):  at java.lang.reflect.Method.invoke(Method.java:521)
12-20 01:22:50.271: E/AndroidRuntime(281):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-20 01:22:50.271: E/AndroidRuntime(281):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-20 01:22:50.271: E/AndroidRuntime(281):  at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:06:56+00:00Added an answer on June 16, 2026 at 4:06 am

    As your logcat result says :

    java.lang.SecurityException: Requires VIBRATE permission 12-20

    means you need to add VIBRATE permission in AndroidManifest.xml as:

    <uses-permission android:name="android.permission.VIBRATE" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this method in App Delegate that makes a window and content view
This question may sprout from the fact that I'm still confused about context and
This is a design question, I noticed that by time by LINQ-to-SQL Context gets
This is in context to an ASP.Net application. The application makes use of a
I have a page that loads content through AJAX. Among this content are some
I have this content script that downloads some binary data using XHR, which is
I want to parse a html content that have something like this: <div id=sometext>Lorem<br>
I have a Drupal setup like this: Content type: Apartments Vocabulary: Areas , that
I'm loading in some HTML content like this: $('#scores').load('scores.php #scores'); Note that It is
Hey guys I simply cannot get this to work. I have some content that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.