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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:08:39+00:00 2026-05-18T10:08:39+00:00

I am trying to build a query for fetching the events from the native

  • 0

I am trying to build a query for fetching the events from the native calendar, i have stored description with 1 word from the these 3 words: “google”, “yahoo”, “stackoverflow”

For example: description=”google”,

As of now, i have made query as below:

Cursor eventCursor = getContentResolver().query(builder.build(),
        new String[] {"event_id", "title", "begin", "end", "allDay","description" }, "Calendars._id=" + calId,
        null, "startDay ASC, startMinute ASC"); 

now, i would like to make query with Description part, how do i?? of my current implementation is wrong, please show me a correct way as if you know !!!

Update:

I have done so far:

public String Fetch_Events_Detail(long From_milliseconds, String kind_website)
 {
  String event_detail = null;

  Uri.Builder builder = calendar_events_URI.buildUpon();
        //long now1 = new Date().getTime();
        ContentUris.appendId(builder, From_milliseconds);
        ContentUris.appendId(builder, From_milliseconds + DateUtils.DAY_IN_MILLIS);


       /* Cursor eventCursor = getContentResolver().query(builder.build(),
                new String[] {"event_id", "title", "begin", "end", "allDay","description" }, "Calendars._id=? and description = ?",
                new String[] { DatabaseUtils.sqlEscapeString(calId),  DatabaseUtils.sqlEscapeString(kind_website)}, "startDay ASC, startMinute ASC"); 
        */

        Cursor eventCursor = getContentResolver().query(builder.build(),
                new String[] {"event_id", "title", "begin", "end", "allDay","description" },"Calendars._id=" + calId,
                null, "startDay ASC, startMinute ASC"); 

        if(eventCursor != null)
        {

         while (eventCursor.moveToNext()) 
         {
            String uid2 = eventCursor.getString(0);
            String event_title = eventCursor.getString(1);
            String event_start = eventCursor.getString(2);
            String event_description = eventCursor.getString(5);

            try
            {
                // SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");
             SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
                Date resultdate = new Date(Long.parseLong(event_start));

                event_detail=sdf.format(resultdate)+"  "+event_title;
                event_detail.trim();

                if(event_description.trim().equalsIgnoreCase(kind_website))
                { 
                 return event_detail;
                }
            }
            catch(NumberFormatException e)
            {
             Log.i("Exception raised", "");
            }
          }
        }

        return null;
 }

Thanx

  • 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-18T10:08:40+00:00Added an answer on May 18, 2026 at 10:08 am
    Cursor eventCursor = getContentResolver().query(builder.build(),
            new String[] {"event_id", "title", "begin", "end", "allDay","description" }, "Calendars._id=? and description = ?",
            new String[] { DatabaseUtils.sqlEscapeString(calId),  DatabaseUtils.sqlEscapeString(description)}, "startDay ASC, startMinute ASC"); 
    

    Try this without calId

    Cursor eventCursor = getContentResolver().query(builder.build(),
            new String[] {"event_id", "title", "begin", "end", "allDay","description" }, "description = ?",
            new String[] {DatabaseUtils.sqlEscapeString(description)}, "startDay ASC, startMinute ASC"); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build query in Play framework, I have select * from
I'm trying to build this query select * from m_orders where year(order_date) = '2010'
I'm trying to build a multidimensional associative array while fetching the results from a
I'm trying to build a complex query with linq. I have a C# method
I'm trying to build a query with Doctrine 2 $qb = $em->createQueryBuilder() ->select('*') ->from('Countries','c')
I'm trying to build a query with hibernate criteria for the following scenario: Two
I am trying to build a CAML query for SharePoint 2007 environment, to get
I am trying to build a query such that some column are built up
I'm trying to build a query using php and mysql, $query = select *
I'm trying to build a query using HQL and OUTER JOIN s and just

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.