2

When I click on the button, then it should retrieve (for now) Title column from CalendarContract.Events and then set the Title retrieved in an Edit Text View.The code I am using is :

public void oc(View view1)
{       
    final String[] EVENT_PROJECTION = new String[] {

        Events.TITLE                  // 1
};

final int PROJECTION_TITLE_INDEX = 1;
Cursor cur = null;
ContentResolver cr = getContentResolver();
Uri uri = Events.CONTENT_URI;   
String selection = "((" +  Events.TITLE + " = ?))";
cur = cr.query(uri, EVENT_PROJECTION, selection, null, null);

// Use the cursor to step through the returned records
while (cur.moveToLast()) {
    String title = null;
    title = cur.getString(PROJECTION_TITLE_INDEX);
    etv2.setText(title);   //etv2 is edit text view

My LogCat shows :

01-13 03:44:27.312: E/SensorManager(23418): thread start
01-13 03:44:27.317: D/SensorManager(23418): registerListener :: handle = 0  name= LSM330DLC Acceleration Sensor delay= 200000 Listener= android.view.OrientationEventListener$SensorEventListenerImpl@423b0`enter code here`238
01-13 03:45:07.787: D/SensorManager(23418): unregisterListener::  Listener= android.view.OrientationEventListener$SensorEventListenerImpl@423b0238
01-13 03:45:07.787: D/Sensors(23418): Remain listener = Sending .. normal delay 200ms
01-13 03:45:07.787: I/Sensors(23418): sendDelay --- 200000000
01-13 03:45:07.787: D/SensorManager(23418): JNI - sendDelay
01-13 03:45:07.787: I/SensorManager(23418): Set normal delay = true
01-13 03:45:07.997: W/IInputConnectionWrapper(23418): getSelectedText on inactive InputConnection
01-13 03:45:07.997: W/IInputConnectionWrapper(23418): setComposingText on inactive InputConnection
01-13 03:45:07.997: W/IInputConnectionWrapper(23418): getExtractedText on inactive InputConnection

The last 3 lines is the main problem due to which Code is not running and gets highlighted in LogCat...Please respond to this asap.

StarPinkER
  • 14,081
  • 7
  • 55
  • 81

0 Answers0