you missed: <uses-permission android:name="android.permission.READ_CONTACTS"></ uses-permission>
in your AndroidManifest.xml On Jun 8, 12:51 am, Saurav Mukherjee <[email protected]> wrote: > i tried out the program n i get SecurityException... > i m using sdk 1.5... > > 06-08 04:47:58.545: ERROR/AndroidRuntime(775): Uncaught handler: thread main > exiting due to uncaught exception > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): java.lang.RuntimeException: > Unable to start activity > ComponentInfo{com.interchain.G/com.interchain.G.AndroidTest}: > java.lang.SecurityException: Permission Denial: reading > com.android.providers.contacts.ContactsProvider uri > content://contacts/people from pid=775, uid=10020 requires > android.permission.READ_CONTACTS > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.app.ActivityThread.access$1800(ActivityThread.java:112) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.os.Handler.dispatchMessage(Handler.java:99) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.os.Looper.loop(Looper.java:123) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.app.ActivityThread.main(ActivityThread.java:3948) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > java.lang.reflect.Method.invokeNative(Native Method) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > java.lang.reflect.Method.invoke(Method.java:521) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > dalvik.system.NativeStart.main(Native Method) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): Caused by: > java.lang.SecurityException: Permission Denial: reading > com.android.providers.contacts.ContactsProvider uri > content://contacts/people from pid=775, uid=10020 requires > android.permission.READ_CONTACTS > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.os.Parcel.readException(Parcel.java:1234) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:145) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:111) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.content.ContentProviderProxy.bulkQuery(ContentProviderNative.java:279) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.content.ContentProviderProxy.query(ContentProviderNative.java:298) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.content.ContentResolver.query(ContentResolver.java:149) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > com.interchain.G.AndroidTest.onCreate(AndroidTest.java:19) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) > 06-08 04:47:58.565: ERROR/AndroidRuntime(775): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) > > any suggestions??? > > On Sun, Jun 7, 2009 at 11:52 AM, Tim H. <[email protected]> wrote: > > > Unless I am doing something wrong, transparency is very flaky in 1.5. > > A number of people have mentioned having to modify their colors to an > > off-number, such as #cc000001. I have also noticed, on an emulator and > > an actual device, where transparency no longer works (maybe out of/low > > memory) and you need to reset. > > > This particular bug occurs when an activity is set to use the > > Transparency theme, after onResume(), occasionally the window takes > > focus (onWindowFocusChanged is called), but is not displayed. If you > > pull down the notification bar, it forces your window to be displayed. > > This same code works as expected in 1.1. To duplicate, run your > > program (maybe 10 times) by starting, clicking HOME, then starting > > again. > > > I am hoping that someone may have found a workaround, or know of a way > > to force the window to be shown (as it already has focus). > > > Here is the code: > > > AndroidTest.java > > > package com.test.androidtest; > > > import android.app.Activity; > > import android.database.Cursor; > > import android.os.Bundle; > > import android.provider.Contacts.People; > > import android.util.Log; > > import android.widget.ListView; > > import android.widget.SimpleCursorAdapter; > > > public class AndroidTest extends Activity { > > protected static final String TAG = "Test"; > > > �...@override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > Log.w(TAG, "onCreate"); > > setContentView(R.layout.main); > > Cursor peeps = > > getContentResolver().query(People.CONTENT_URI, new > > String[] {People._ID, People.NAME, People.NOTES}, null, null, null); > > startManagingCursor(peeps); > > ListView list = (ListView) findViewById(R.id.ListView01); > > SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, > > android.R.layout.simple_list_item_1, peeps, > > new String[] { People.NAME, People.NOTES }, > > new int[] { android.R.id.text1, > > android.R.id.text2 }); > > list.setAdapter(adapter); > > } > > > } > > > main.xml > > > <RelativeLayout android:id="@+id/RelativeLayout01" > > xmlns:android="http://schemas.android.com/apk/res/android" > > android:layout_width="fill_parent" android:layout_height="200dip" > > android:background="#cc000000"> > > <ListView android:id="@+id/ListView01" > > android:layout_height="fill_parent" > > android:layout_width="fill_parent"></ListView> > > </RelativeLayout> > > > AndroidManifest.xml > > > <?xml version="1.0" encoding="utf-8"?> > > <manifest xmlns:android="http://schemas.android.com/apk/res/android" > > android:versionCode="1" > > android:versionName="1.0.0" package="com.test.androidtest"> > > <application android:icon="@drawable/icon" android:label="@string/ > > app_name" android:theme="@style/Theme.Transparent"> > > <activity android:name=".AndroidTest" android:launchMode="singleTop" > > android:theme="@style/Theme.Transparent"> > > <intent-filter> > > <action android:name="android.intent.action.MAIN"></action> > > <category android:name="android.intent.category.LAUNCHER"></ > > category> > > </intent-filter> > > </activity> > > </application> > > <uses-sdk android:minSdkVersion="2"></uses-sdk> > > <uses-permission android:name="android.permission.READ_CONTACTS"></ > > uses-permission> > > </manifest> > > > Using colors.xml and styles.xml from samples > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

