Hi Sadhna,

You can use cursor.getcount() method to check this. if its greater then 
zero then there is some data in table.

i.e
Cursor cursor = getContentResolver().query(
ContactsContract.
CommonDataKinds.Phone.CONTENT_URI, null, null,
                null, null);
       * totalcontact=cursor.getCount();*
        Log.i("fav all contact",""+totalcontact);
       * if (totalcontact== 0)* {
            Toast.makeText(Fav_contacts.this,"You don't have any contacts 
to display" ,200).show();
        else
            do your stuff


Same way you can query about the any database of Application.

Thanks
Juned Khan 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to