CallLogQueryActivity.java :  » UnTagged » pracprojects » com » cnyao » phot » Android Open Source

Android Open Source » UnTagged » pracprojects 
pracprojects » com » cnyao » phot » CallLogQueryActivity.java
package com.cnyao.phot;

import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.CallLog.Calls;
import android.widget.TextView;

public class CallLogQueryActivity extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.call_log);
    
     String tempStr="Columns: ";
    ContentResolver resolver=this.getContentResolver();
     Cursor cursor = resolver.query(Calls.CONTENT_URI,
        null, null, null, Calls.DEFAULT_SORT_ORDER);
     cursor.getCount();
     cursor.moveToLast();
     for(int i=0;i<cursor.getColumnCount();i++){
       tempStr+=cursor.getColumnName(i)+",";
       //tempStr+=cursor.getString(i)+",";
     }
     TextView tv1=(TextView)findViewById(R.id.callername);
     tv1.setText(tempStr);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.