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 8017577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:53:13+00:00 2026-06-04T20:53:13+00:00

@Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()){ case

  • 0
@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()){
    case R.id.upArrow:
        upSound.start();

        En_description.setText("\"Straight Ahead\"");
        break;

    case R.id.downArrow:
        downSound.start();

        En_description.setText("\"Down\"");
        break;

    case R.id.rightArrow:
        rightSound.start();

        En_description.setText("\"Right\"");
        break;

    case R.id.leftArrow:
        leftSound.start();

        En_description.setText("\"Left\"");
        break;
    default: 

    }
}

The code is simple when I press on an arrow it types the direction of it and plays sound
for some reason it works sometime and other times I get a force close HELP
Thanks this is the log

05-24 17:52:20.384: W/dalvikvm(343): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
05-24 17:52:20.394: E/AndroidRuntime(343): Uncaught handler: thread main exiting due to uncaught exception
05-24 17:52:20.404: E/AndroidRuntime(343): java.lang.NullPointerException
05-24 17:52:20.404: E/AndroidRuntime(343):  at com.aboutera.learnArabic.Directions.onClick(Directions.java:77)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.View.performClick(View.java:2364)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.View.onTouchEvent(View.java:4179)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.View.dispatchTouchEvent(View.java:3709)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
05-24 17:52:20.404: E/AndroidRuntime(343):  at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
05-24 17:52:20.404: E/AndroidRuntime(343):  at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
05-24 17:52:20.404: E/AndroidRuntime(343):  at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.os.Looper.loop(Looper.java:123)
05-24 17:52:20.404: E/AndroidRuntime(343):  at android.app.ActivityThread.main(ActivityThread.java:4363)
05-24 17:52:20.404: E/AndroidRuntime(343):  at java.lang.reflect.Method.invokeNative(Native Method)
05-24 17:52:20.404: E/AndroidRuntime(343):  at java.lang.reflect.Method.invoke(Method.java:521)
05-24 17:52:20.404: E/AndroidRuntime(343):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-24 17:52:20.404: E/AndroidRuntime(343):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-24 17:52:20.404: E/AndroidRuntime(343):  at dalvik.system.NativeStart.main(Native Method)
05-24 17:52:20.414: I/dalvikvm(343): threadid=7: reacting to signal 3
05-24 17:52:20.414: E/dalvikvm(343): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
05-24 17:52:22.534: I/Process(343): Sending signal. PID: 343 SIG: 9
  • 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-04T20:53:14+00:00Added an answer on June 4, 2026 at 8:53 pm

    Check to verify that upSound, downSound, leftSound, rightSound are all initialized(not null) before using them

    if (upSound != null)
      upSound.start();
    

    do for downSound, leftSound, rightSound also

    You can initialize the sounds on the fly to make sure if the sound is null it gets played anyways..

      if (upSound == null)
         upSound = MediaPlayer.create(Directions.this, R.raw.up_sound);
      upSound.start();
    

    Additionally, your textView En_description may also be null which could cause this crash as well.
    Make sure wherever you are retrieving En_description (using findViewById) it is completing successfully

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

button3.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub
imgvw_back.setOnClickListener(this); imgvw.setOnClickListener(this); static id=10 @Override public void onClick(View v) { // TODO Auto-generated method
@Override public void onCancel() { // TODO Auto-generated method stub ERROR:The method onCancel() of
I have this code: button1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //
Here's my code: myButton.setOnClickListener( new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1)
@Override public void onCreate(SQLiteDatabase db) { db.execSQL(DATABASE_CREATE); // providers data // db.execSQL(insert into //
I have this code: @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { GLES20.glClearColor(0, 0,
this is my thread: @Override public void run() { Log.d(ConnectionThread,Starting Server Connection); try {
public class CursorAtStartFocusListener extends FocusAdapter { @Override public void focusGained(java.awt.event.FocusEvent evt) { Object source
Thread thread = new Thread(new Runnable() { @Override public void run() { try {

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.