deleting whole call log

by shaz » Fri, 19 Dec 2008 03:03:40 GMT


Sponsored Links
 I'm trying the whole call log  using following code

int deleted_rows = cur_context.getContentResolver().delete
(CallLog.Calls.CONTENT_URI, null,null);

The deletion is successful and whole call log is emptied but
deleted_rows always contain 0. Is this a bug in android ?

the following calls always work fine and return value is also correct

int deleted_rows = cur_context.getContentResolver().delete(Uri.parse
("content://sms"), null,null);
int deleted_rows =cur_context.getContentResolver().delete
(People.CONTENT_URI, null,null);

I testing on SDK version 1.0 using emulator.Please let me know if
there is any issue in my code and is this android bug?


thanks,
shahzad

--~--~---------~--~----~------------~-------~--~----~



deleting whole call log

by shahzad ahmad » Fri, 19 Dec 2008 17:22:41 GMT


 any help ?





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Fwd: Info required on call to onLocationChanged() functionality.

Hi,
         I am developing a GPS based application, and for my application I
need to get the current location, and also need to update the UI as and when
the location changes. So for that I am using Location Manager and location
listener package as follows,

public class HelloMapViewSec extends MapActivity
{

 public void onCreate(Bundle savedInstanceState)
 {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        LocationManager lm = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
  myLocationListener = new MyLocationListener();
  lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
myLocationListener);
  Location myLocation = lm.getLastKnownLocation("network"); //using "gps"
returned NULL
  if(myLocation != null)
  {
   lat =  myLocation.getLatitude() * 1E6;
   lng =  myLocation.getLongitude() * 1E6;
   GeoPoint point = new GeoPoint(lat.intValue(),lng.intValue());
   //And had an overlay to point in MapView
  }
 }

 //MyLocationListener Class defined for instantiating a location listener
    private class MyLocationListener implements LocationListener
    {
        public void onLocationChanged(Location loc)
  {
            if (loc != null)
   {
                Toast.makeText(getBaseContext(),
                    "Location changed : Lat: " + loc.getLatitude() +
                    " Lng: " + loc.getLongitude(),
                    Toast.LENGTH_SHORT).show();
            }
        }

        public void onProviderDisabled(String provider) {
            // TODO Auto-generated method stub
         System.out.println("GPS : Provider Disabled" + provider);
        }

        public void onProviderEnabled(String provider) {
            // TODO Auto-generated method stub
         System.out.println("GPS : Provider Enabled" + provider);
        }

        public void onStatusChanged(String provider, int status,
            Bundle extras) {
            // TODO Auto-generated method stub
         System.out.println("GPS : Status Changed to " + provider + "[" +
status + "]");
        }
    }
}

I am able to get the current user details using the above code, but I am not
able to see the LocationListener's onLocationChanged() functionality getting
called within a distance coverage of 10/100m. I have tried by changing the
minDistance parameter of lm.requestLocationUpdates() from 10 to 100, but
still I dont see any quick response. I need a call to LocationListener's
onLocationChanged() functionality within 10/100m so that I can do
speed/distance calculations.
On further analysis I saw that the onLocationChanged() will be called on a
500m change only.
How can I make the a call to LocationListener's onLocationChanged()
functionality within 10/100m travel?
If not possible then is there any alternate method/means for calculating the
speed/distance travelled by user?

Thanks and regards,
Ruppin.

-- 

2. resources variable

Hi,

I have a general question about pass in the resource variable:

when i reference a string type, it's posible to do it this way
(reference):

Toast.makeText(this, R.string.app_error, Toast.LENGTH_LONG).show();

or this way (instance by using getResources method):

Resources myResources = getResources();
CharSequence styledText = myResources.getText(R.string.stop_message);

But when it's an Array, only the second method is possible:

String[] stringArray;
stringArray = myResources.getStringArray(R.array.string_array);

Why it's not possible to reference an Array using the code line?

String[] stringArray;
stringArray = R.array.string_array;

Thanks,
Elad

-- 

3. How to use GPS receiver in Gphone

4. Long boot for emulator.. avoid restart?

5. Newbie needs help Updating my ADP1

6. Flash animation, question.

7. Help regarding facebook integration applicaiton