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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:38:05+00:00 2026-06-10T16:38:05+00:00

Alright folks, I’m getting a syntax error on a line of code and I

  • 0

Alright folks, I’m getting a syntax error on a line of code and I can’t seem to figure out why. I’ve only been tinkering with android for a short time, but I’m pretty certain I’ve followed the given examples rather well, but just cant get rid of this error for the life of me. The code is for the contact picker so I can populate an edittext with a persons number and then send a picture using an mms intent to that number. I’ve marked the spot where I’m getting the error, and cant quite finish what i was attempting with it until its resolved. (only showing the section with the problem)

break;


case R.id.contact:
  Intent k = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
    startActivityForResult(k, 1);


  @Overide
  public void onActivityResult (int reqCode, int resultCode, Intent data) {  //<Getting the syntax errors here
  super.onActivityResult(reqCode, resultCode, data);

   {
    if (resultCode == Activity.RESULT_OK) {
      Uri contactData = data.getData();
      Cursor cur = managedQuery(contactData, null, null, null, null);
      ContentResolver contect_resolver = getContentResolver();

      if (cur.moveToFirst()) {
        String id = cur.getString(cur.getColumnIndexOrThrow(ContactsContract.Contacts._ID));
        String name = "";
        String no = "";

        Cursor phoneCur = contect_resolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, 
            ContactsContract.CommonDataKinds.Phone.CONTACT_ID = " = ?", new String [] { id }, null);

        if (phoneCur.moveToFirst()) { name = phoneCur.getString(phoneCur.getColumnIndex (ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
        no = phoneCur.getString(phoneCur.getColumnIndex (ContactsContract.CommonDataKinds.Phone.NUMBER));

        }
      }
    }
  }
}

break;  

Now the errors it is throwing are:
- Syntax error on token "(", ; expected
- Syntax error on token(s), misplaced construct(s)
- Syntax error on token ")", ; expected
- Syntax error on token ",", ; expected
- Syntax error on token ")", ; expected
- Syntax error on token "(", ; expected

All in that line. Im totally clueless.

  • 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-10T16:38:06+00:00Added an answer on June 10, 2026 at 4:38 pm

    All in what line?

    In any case, you’re trying to define a method (onActivityResult) right in the middle of a switch statement, if the first few lines of context are to be believed. You can’t define a method there.

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

Sidebar

Related Questions

Alright I've been debugging the whole day but can't figure out what the problem
Alright, I'm trying to figure out why I can't understand how to do this
Alright, here I am again trying to write code from scratch and I can't
Alright so I have been looking around (on SO and Google) to see if
Alright, so I got this code for gluLookAt: lookAt = new Vector3f(-player.pos.x, -player.pos.y, -player.pos.z);
Alright folks, my brain is fried. I'm trying to fix up some EMLs with
Alright I'm pretty new to programming and stuff and I'm now trying to code
Alright, I or someone I work with broke the syntax here somewhere, and I'm
Alright, so I've been trying to implement a simple binary search tree that uses
Alright when I do the code: <script type = text/javascript > document.write((new Date).getTime()); </script>

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.