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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:22:38+00:00 2026-05-27T21:22:38+00:00

I am trying to do a search through the contacts database for an email

  • 0

I am trying to do a search through the contacts database for an email address and get the contact ID of that person if it finds it but everytime I try I get a syntax error

01-03 17:15:10.574: E/AndroidRuntime(7907): java.lang.RuntimeException: Unable to start receiver com.app.notifyme.GmailReciever: android.database.sqlite.SQLiteException: near "@gmail": syntax error: , while compiling: SELECT raw_contact_id FROM view_data data WHERE (1) AND ((data1=johnsmith@gmail.com))
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2125)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.app.ActivityThread.access$1500(ActivityThread.java:122)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.os.Looper.loop(Looper.java:137)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.app.ActivityThread.main(ActivityThread.java:4340)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at java.lang.reflect.Method.invokeNative(Native Method)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at java.lang.reflect.Method.invoke(Method.java:511)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at dalvik.system.NativeStart.main(Native Method)
01-03 17:15:10.574: E/AndroidRuntime(7907): Caused by: android.database.sqlite.SQLiteException: near "@gmail": syntax error: , while compiling: SELECT raw_contact_id FROM view_data data WHERE (1) AND ((data1=jtopor0910@gmail.com))
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:179)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.content.ContentProviderProxy.query(ContentProviderNative.java:358)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.content.ContentResolver.query(ContentResolver.java:310)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at com.app.notifyme.GmailReciever.createNotification(GmailReciever.java:362)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at com.app.notifyme.GmailReciever.onReceive(GmailReciever.java:111)
01-03 17:15:10.574: E/AndroidRuntime(7907):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2118)

this is my query

Cursor contact = context.getContentResolver().query(Data.CONTENT_URI,new String[] {Data.RAW_CONTACT_ID},Data.DATA1  + "=" + from,null,null);

what is wrong with my syntax? does it have something to do with the@?

  • 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-05-27T21:22:38+00:00Added an answer on May 27, 2026 at 9:22 pm

    Try putting quotes around your email, ie, change the third parameter in your method call to

    Data.DATA1  + "='" + from + "'"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to search through my inbox to find specific email's but there every
I'm trying to search Netflix through their API, but without logging anyone in (because
I'm trying to basically do a search through the database with Perl to tell
I'm trying using NHibernate.Search to get Lucene.NET Score through projections. My domain object implements
I am trying to search through a URL for a matching string, but the
Im trying to search through a text file and find the valid email addresses.
I'm trying to write a script that will search through a html file and
I am trying to write an app that does a person search of my
I am trying to write a quick search that searches a List<String> Instead of
I'm trying to search through this Json array using PHP: {count:2,items:{milestone:[{id:3107,username:TomSmith1,userid:1620602,date:2012-01-12 16:49:26,projectid:804,projectname:TEST PROJECT,reason:Partial payment

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.