[android-developers] How to query multiple number of a contact

2009-06-16 Thread Meryl Silverburgh
Hi, I have the following code which queries 1 number of a contact. It works. But how can I change it so that I can query multiple numbers (work, mobile, home) for the same contact and the type of each number? int phoneColumnIndex = cursor.getColumnIndex(People.NUMBER); if

[android-developers] how can i launch the intent to pick image from SD card?

2009-06-13 Thread Meryl Silverburgh
Hi, Can you please tell me how can i launch the intent to pick image from SD card? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to

[android-developers] Create an Adapter for Gallery

2009-06-10 Thread Meryl Silverburgh
Hi, I am trying to create a simple adapter for Gallery. And I call setAdapter() of my Gallery. The text is displayed on screen, but they are overlapping each other. Do I need to set the size of the TextView that I create to make sure it has enough space for the text it is holding? if yes, how

[android-developers] How to use SimpleCursorAdapter to include Button

2009-06-09 Thread Meryl Silverburgh
Hi, I have read the Gallery2.java example, which show how to map a Column's value to an elment in the view I want to create (in this case, it maps 'NAME' to text1 element0. But what if I have a Button in my view, how can I know which Person is being clicked? or how can I query the person's info

[android-developers] Question about picking an image from sd card

2009-06-08 Thread Meryl Silverburgh
Hi, I have the following code to pick an image from sd card: private void pickPhotoAction() { Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null); intent.setType(image/*); intent.putExtra(crop, true); intent.putExtra(aspectX, 1);

[android-developers] How to query all phone numbers of all Contacts in the Database?

2009-06-05 Thread Meryl Silverburgh
Hi, Can you please tell me how can I query all phone numbers of all Contacts in the Database? Where can I find some examples for that? Thank you. Regards, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android

[android-developers] Re: add my Launcher.apk into emulator

2009-05-27 Thread Meryl Silverburgh
Can you please tell me where in android code which specify using Launcher.apk when android starts? I have grep 'Launcher' in the code, i can't find anywhere it specify android to use Launcher.apk. On Fri, May 22, 2009 at 9:51 AM, Dianne Hackborn hack...@android.com wrote: You need to give it a

[android-developers] How can I clone a View and its children

2009-05-21 Thread Meryl Silverburgh
Hi, If I have a reference to a View, how can I clone it with all its children and grandchildren (i.e. deep cloning)? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to

[android-developers] How to overlay an image on a view

2009-05-19 Thread Meryl Silverburgh
Hi, I need to create a function which input is a reference is a view, and the function basically creates a new View which overlay an image on top of the input view? What is the best way to achieve that? I am thinking of create a new ViewGroup (as my output), add the input view as a child to

[android-developers] Re: Exception: Finalizing cursor android.database.sqlite.SQLiteCursor

2009-05-12 Thread Meryl Silverburgh
the Cursor? The Caller of the query method? or the ContentProvider (since it is the one creating the Cursor) @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { On Wed, May 6, 2009 at 1:39 PM, Meryl

[android-developers] Exception: Finalizing cursor android.database.sqlite.SQLiteCursor

2009-05-06 Thread Meryl Silverburgh
I am seeing the exception in 'adb logcat'. But I don't know if it is caused by my application or android platform. Can you please give me any idea how to troubleshoot this exception? Thank you. I/dalvikvm( 713): Uncaught exception thrown by finalizer (will be discarded): I/dalvikvm( 713):

[android-developers] Re: How drawing cache in View works

2009-05-04 Thread Meryl Silverburgh
Can you please tell me how does android determine when View should enable the drawing cache? I try calling in my class (which inherits form LinearLayout) Bitmap drawingCache = getDrawingCache(); I get a null in my drawingCache. Thank you. On Thu, Apr 30, 2009 at 3:48 PM, Romain Guy

[android-developers] Question about CellLayout.CellInfo Class

2009-05-04 Thread Meryl Silverburgh
Hi, My understanding of CellLayout.CellInfo is it is a data-structure class which represents an item in CellLayout. My question is why it needs to implements ContextMenu.ContextMenuInfo? What is the relationship between ContextMenu and CellLayout? Thank you.

[android-developers] Re: How to Snap a picture of a Layouts contents?

2009-05-01 Thread Meryl Silverburgh
Hi, I am doing a similar thing. But I need to do that to a ViewGroup. But what I find out is I see everything exception the background of my ViewGroup. Can you please tell me why? or if background drawable of ViewGroup is painted differently? Thank you. On Fri, May 1, 2009 at 12:42 PM, dan

[android-developers] Application Not Responding (ANR) dialog

2009-04-27 Thread Meryl Silverburgh
In the follow blog, it talks about Application Not Responding (ANR) dialog http://developer.android.com/guide/practices/design/responsiveness.html Can you please tell me where in the code which pop up this Application Not Responding (ANR) dialog? Or how can I adjust the timer for this dialog so

[android-developers] Application Not Responding (ANR) dialog

2009-04-27 Thread Meryl Silverburgh
In the follow blog, it talks about Application Not Responding (ANR) dialog http://developer.android.com/guide/practices/design/responsiveness.html Can you please tell me where in the code which pop up this Application Not Responding (ANR) dialog? Or how can I adjust the timer for this dialog so

[android-developers] How to update a Cursor

2009-04-24 Thread Meryl Silverburgh
Hi, I call ContentResolver's query method to get a Cursor, and I would like to update the title of that row to 'new title' can you please tell me how to do it? final ContentResolver cr = context.getContentResolver(); Cursor c = cr.query(MY_CONTENT_URI, new String[] { title},

[android-developers] Re: How to update a Cursor

2009-04-24 Thread Meryl Silverburgh
an exception here: int xColumn = c.getColumnIndexOrThrow(x); } On Fri, Apr 24, 2009 at 3:03 PM, Mark Murphy mmur...@commonsware.com wrote: Meryl Silverburgh wrote: Hi, I call ContentResolver's query method to get a Cursor, and I would like to update the title of that row to 'new

[android-developers] How to dump the content of sqlite via adb shell command

2009-04-16 Thread Meryl Silverburgh
Hi, I am trying to dump the content of sqlite via adb shell command. Here is what i did: $ adb shell * daemon not running. starting it now * * daemon started successfully * # sqlite3 SQLite version 3.5.9 qlite .databases seq name file --- ---

[android-developers] Re: How to dump the content of sqlite via adb shell command

2009-04-16 Thread Meryl Silverburgh
is the name of the DB file? On 4/16/09, Marco Nelissen marc...@android.com wrote: On Thu, Apr 16, 2009 at 6:08 PM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, I am trying to dump the content of sqlite via adb shell command. Here is what i did: $ adb shell * daemon not running

[android-developers] How to debug the Launcher activity of android in eclipse

2009-04-15 Thread Meryl Silverburgh
Hi, I am trying to following this documentation 'http://source.android.com/using-eclipse' to debug android Launcher Activity in eclipse. It said ' You may need to open the Debug perspective (next to the Java perspective icon in the upper-right, click the small Open Perspective icon and select

[android-developers] How to scale a Bitmap

2009-04-14 Thread Meryl Silverburgh
Hi, I have constructed a Bitmap object in Java. Can you please tell me how can I scale it (x, y with a different ratio) on android? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers

[android-developers] Re: How to print errno in native code in android

2009-04-07 Thread Meryl Silverburgh
On Tue, Apr 7, 2009 at 1:01 AM, David Turner di...@android.com wrote: On Tue, Apr 7, 2009 at 2:15 AM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, I am trying to use LOGE function to display the value of errno. LOGE(errno: %d\n, errno); But what I get errno: 1 But '1

[android-developers] How can I see LOGV content in 'adb logcat'

2009-04-06 Thread Meryl Silverburgh
Hi, I put calls to LOGV() in my cpp file in WebKit code in andorid, but I don't see any log statements when I run 'adb logcat' in another shell. But as soon as I change it to LOGE(), i see them. Can you please tell me how can I see the log content of LOGV? Thank you.

[android-developers] How to become root in emulator?

2009-04-06 Thread Meryl Silverburgh
Hi, Can you please tell me how can I become root in android emulator? I have googled and find this link: http://www.androidhere.com/ANDROID-NEWS/Technology/200811/19-Hack--Howto-get-root-on-your-G1_41.html so i tried # adb shell and the follow the steps #mount -o remount,rw -t yaffs2

[android-developers] How to print errno in native code in android

2009-04-06 Thread Meryl Silverburgh
Hi, I am trying to use LOGE function to display the value of errno. LOGE(errno: %d\n, errno); But what I get errno: 1 But '1' is not a valid errno (I look at errno.h). Can you please tell me what am I doing wrong? Thank you. --~--~-~--~~~---~--~~ You received

[android-developers] Remove binaries after I download and compile android source

2009-04-01 Thread Meryl Silverburgh
Hi, I have download and built android source on my local machine. Can you please tell me how can I remove all the binaries (*.o, executables) to clean up everything? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[android-developers] How does android decide which drawable to use when a widget has focus

2009-03-24 Thread Meryl Silverburgh
Hi, I have selector drawable for my widget. But for some reason, the focused drawable (specified below) is not shown. When I use hierarchyViewer, it does show my widget has focus (the 'hasFocus' is true). And its parent has Focus too and its grand parent has Focus. My question is why andorid

[android-developers] android:disabledAlpha for ToggleButton

2009-03-23 Thread Meryl Silverburgh
For ToggleButton, there is an attribute for 'disbledAlpha'. Why there is no same attribute for ImageButton? How can I achieve the same thing for an ImageButton (grey out when the button is disabled). Thank you. The alpha to apply to the indicator when disabled. Must be a floating point

[android-developers] Question about layout child widget in a compound widget

2009-03-20 Thread Meryl Silverburgh
Hi, I am trying to create a compound widget which has 2 labels (i.e. textview), one label on each line. public class TwoLabel extends LinearLayout { private TextView mLabel; private TextView mLabel2; public TwoLabel(Context context, AttributeSet attrs, int defStyle) {

[android-developers] Re: Question about layout child widget in a compound widget

2009-03-20 Thread Meryl Silverburgh
see the first label but not the second one. On Fri, Mar 20, 2009 at 6:50 PM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, I am trying to create a compound widget which has 2 labels (i.e. textview), one label on each line. public class TwoLabel extends LinearLayout

[android-developers] Re: Question about layout child widget in a compound widget

2009-03-20 Thread Meryl Silverburgh
of their parent. So the second one is outside of the parent. On Fri, Mar 20, 2009 at 6:53 PM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi,  I am trying to create a compound widget which has 2 labels (i.e.  textview), one label on each line.  public class TwoLabel extends

[android-developers] Re: Question about layout child widget in a compound widget

2009-03-20 Thread Meryl Silverburgh
PM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Romain, Thank you. But I change the height to wrap_content for both items. I still see only 1 item in the emulator. Any idea please? On Fri, Mar 20, 2009 at 8:48 PM, Romain Guy romain...@google.com wrote: You specified a height

[android-developers] how to set android font style to bold

2009-03-19 Thread Meryl Silverburgh
Hi, In android, if I have a TextPaint object, how can I set the font style to be 'bold'? I can't find any method in TextPaint or Paint to allow me do that. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[android-developers] How to detect Fling action in my widget

2009-03-18 Thread Meryl Silverburgh
Hi, Can you please tell me how can I detect Fling action in my own widget? I have implemented my widget as OnGestureListener. And like in Gallery, I have a GestureDetector mGestureDetector = new GestureDetector(this); For my onTouchEvent(), I have @Override public boolean

[android-developers] Re: How to detect Fling action in my widget

2009-03-18 Thread Meryl Silverburgh
the correct boolean-values in the other methods of your OnGestureDetector (onDown, onScroll, etc). On Mar 18, 2:51 pm, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, Can you please tell me how can I detect Fling action in my own widget? I have implemented my widget

[android-developers] Re: How to implement android's Gallery fling action in my own widget

2009-03-16 Thread Meryl Silverburgh
the onFling method in your listener to handle flings. On Mar 12, 1:27 pm, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, Can you please tell me how implement android's Gallery fling action (with the animation) in my own widget? Thank you.- Hide quoted text - - Show quoted text

[android-developers] Trying to understanding Gallery fling source code

2009-03-16 Thread Meryl Silverburgh
I am trying to understand how Gallery implements it fling behaviour. I appreciate if someone can help me understand 1. why it needs special handing for ACTION_UP and ACTION_CANCEL? 2. why it does not check the retValue before calling UP/CANCEL's handling? 3. what does onUp() trying to do? Why it

[android-developers] Question about TabHost implementation

2009-03-13 Thread Meryl Silverburgh
I have looked at TabHost code and I have a question. Why it expects TabContent to be a FrameLayout? I see it casts mTabContent to be FrameLayout. Why TabContent can't be an instance of ViewGroup, but a FrameLayout? Thank you. --~--~-~--~~~---~--~~ You received

[android-developers] How to implement android's Gallery fling action in my own widget

2009-03-12 Thread Meryl Silverburgh
Hi, Can you please tell me how implement android's Gallery fling action (with the animation) in my own widget? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this

[android-developers] How to port AbsoluteLayout to FrameLayout?

2009-03-12 Thread Meryl Silverburgh
Hi, AbsoluteLayout has become obsolete, I need to convert it to FrameLayout. My problem is in AbsoluteLayout.LayoutParams, I can specify (x,y) in the constructor, which specify the location of my view during layout. How can I achieve using FrameLayout + FrameLayout.LayoutParams? Thank you.

[android-developers] How to layout a widget programmically in java

2009-03-10 Thread Meryl Silverburgh
Hi, In xml layout, I can specify these parameters: android:layout_centerInParent=true android:layout_marginLeft=4dp android:layout_marginRight=4dp Can you please tell me what functions I can call in

[android-developers] Re: Android Web Browser profiling

2009-03-10 Thread Meryl Silverburgh
Can you please tell me how to enable ANDROID_INSTRUMENT ? On Tue, Mar 10, 2009 at 9:45 PM, vinay harugop vinc...@gmail.com wrote: ravi, I tried the same and found similar conflicts in the namespace when ANDROID_INSTRUMENT was enabled. Modify platform/android/SystemTimeAndroid.cpp,

[android-developers] Activity dispatchKeyEvent(KeyEvent event) method always return false?

2009-03-04 Thread Meryl Silverburgh
Hi, Can you please tell me why Activity dispatchKeyEvent(KeyEvent event) method always return false? I press UP/DOWN key (on keyboard), and I see the focus of each button moves from one to another. So I think the Activity has handled the UP/DOWN key. My question is why dispatchKeyEvent() always

[android-developers] background drawable

2009-03-02 Thread Meryl Silverburgh
I have created a background drawable for my widget. How can I specify the size of the background drawable so that it won't stretch of my widget? ?xml version=1.0 encoding=utf-8? layer-list xmlns:android=http://schemas.android.com/apk/res/android; item android:id=@+android:id/background

[android-developers] Android source code to find out which drawable a widget should use for its background?

2009-03-01 Thread Meryl Silverburgh
Hi, Can you please tell me where is the android code which picks the different drawable will be used as background when it has focus? For example, I have the following setup for my widget: ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android;

[android-developers] How can I create a custom composite widget in android

2009-02-25 Thread Meryl Silverburgh
Hi, I have read the LabelView example in APIDemo which show how to create a custom widget. However, what if I want to create a custom widget which is a composite of existing android widget? For example, in my currently activity, I have this in my layout xml file which has 2 bottoms left, right

[android-developers] Re: How can I create a custom composite widget in android

2009-02-25 Thread Meryl Silverburgh
On Wed, Feb 25, 2009 at 3:52 PM, Mark Murphy mmur...@commonsware.com wrote: Meryl Silverburgh wrote: I know my custom widget need to be inherited from view, but if i do that, I can't do 'setContentView()' in my custom widget class (since that is an Activity method). If you need to turn

[android-developers] Question about using LayoutInflater

2009-02-25 Thread Meryl Silverburgh
I have a question about using LayoutInflater. I have a class which inherits from 'View'. It calls LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (inflater != null) {

[android-developers] Re: Question about using LayoutInflater

2009-02-25 Thread Meryl Silverburgh
Mark, Thank you for your help. On Wed, Feb 25, 2009 at 6:00 PM, Mark Murphy mmur...@commonsware.com wrote: Meryl Silverburgh wrote: I have a question about using LayoutInflater. I have a class which inherits from 'View'. It calls LayoutInflater inflater = (LayoutInflater

[android-developers] How to customize background drawable for Gallery in android

2009-02-24 Thread Meryl Silverburgh
Hi, I am trying to customize background drawable for Gallery widget in android. So I took the Gallery1.java in APIDemo and try changing the background drawable of Gallery. In Gallery1.java, I add: // Reference the Gallery view Gallery g = (Gallery) findViewById(R.id.gallery);

[android-developers] How can I scroll the item in a Gallery programmically?

2009-02-23 Thread Meryl Silverburgh
Hi, I have looked at the Gallery widget api, http://code.google.com/android/reference/android/widget/Gallery.html But can you please tell me how can I scroll an item in the Gallery programmically? e.g. i want to write code to scroll the gallery by 1 item at a time. Thank you.

[android-developers] Re: How can I scroll the item in a Gallery programmically?

2009-02-23 Thread Meryl Silverburgh
I have looked at the Gallery.java source code, it has 2 functions which move the selected position: movePrevious() or moveNext(), however both are 'default' visibility. Can you please tell me how can I call those 2 method programmically? Thank you. On Mon, Feb 23, 2009 at 12:19 PM, Meryl

[android-developers] How to customize Gallery Widget in android?

2009-02-23 Thread Meryl Silverburgh
Hi, Can you please tell me how can I customize drawable (background image for disable mode, focus mode, etc) for Gallery Widget? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group.

[android-developers] How can I get the child of a Widget

2009-02-20 Thread Meryl Silverburgh
Hi, In my layout.xml, I have a child Widget under my custom widget MyWidget My question is in my java code of my parent widget (MyWidget), how can I get a reference to the child Widget (MyChildWidget)? com.mycompany.widget.MyWidget android:id=@android:id/widget

[android-developers] Question about how android calling widget's constructor

2009-02-18 Thread Meryl Silverburgh
Hi, Can you please help me understand how android consturcts widget? I have these 2 cases, com.mycompany.MyWidget android:id=@+id/mywidget_button style=@style/MyWidget com.mycompany.MyWidget android:id=@+id/mywidget_button My question is why they call the same constructors (I have print

[android-developers] Question about defining selector drawable

2009-02-15 Thread Meryl Silverburgh
Hi, I am trying to setup a selector drawable in my asset file like this: * 2 different images for 'on'/'off' mode in rest mode (i.e. it does not has focus) * another 2 different images for 'on'/'off' mode in focus mode (i.e. it has the focus). In my case, the rest mode works, but the 'focus'

[android-developers] Re: Question about defining selector drawable

2009-02-15 Thread Meryl Silverburgh
android:state_checked=true android:drawable=@drawable/on / So I appreciate if you can help me out. Thank you. On Sun, Feb 15, 2009 at 12:32 AM, Romain Guy romain...@google.com wrote: use state_selected, not focused. On Sun, Feb 15, 2009 at 12:08 AM, Meryl Silverburgh silverburgh.me

[android-developers] Question about defining selector drawable

2009-02-14 Thread Meryl Silverburgh
Hi, I am trying to setup a selector drawable in my asset file like this: * 2 different images for 'on'/'off' mode in rest mode (i.e. it does not has focus) * another 2 different images for 'on'/'off' mode in focus mode (i.e. it has the focus). In my case, the rest mode works, but the 'focus'

[android-developers] Please help me in defining the style of my custom widget in my theme.

2009-02-14 Thread Meryl Silverburgh
Hi, I have tried everything thing I can thing of in defining the style of my widget in my theme. But I still can't get it to work. I have posted my questions to various forum/newgroup, I can't get my problem resolved. I appreciate if someone can help me. I am tying to define the style of

[android-developers] Re: How can I specify the default style of my widget

2009-02-13 Thread Meryl Silverburgh
:59 PM, birds fly birdsact...@gmail.com wrote: hi you can use Theme , The theme can include all style information. style name=string [parent=string] item name=string/item /style On Fri, Feb 13, 2009 at 8:16 AM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, I create my own

[android-developers] Re: How can I specify the default style of my widget

2009-02-13 Thread Meryl Silverburgh
version=1.0 encoding=utf-8? resources style name=MyWidget item name=android:background@drawable/btn_mywidget_bg/item /style /resources Can you please tell me what am I missing? On Fri, Feb 13, 2009 at 2:38 PM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Thank you. I have

[android-developers] Re: TERRIBLE BUG #2 - the GC from HELL

2009-02-12 Thread Meryl Silverburgh
Yeah. Thank you. On Thu, Feb 12, 2009 at 9:53 AM, Sundog sunns...@gmail.com wrote: Romain, Just a quick thank you to you and others, especially Dianne, who field such things. Most of us are very grateful for your hard work and patience. On Feb 12, 9:54 am, Romain Guy

[android-developers] How can I specify the default style of my widget

2009-02-12 Thread Meryl Silverburgh
Hi, I create my own widget with its own drawable for background. So in my styles.xml file, I have this: resources style name=MyWidget item name=android:background@drawable/btn_mywidget_bg/item /style /resources In my main.xml, if i specified my 'style' attribute, my

[android-developers] Need help in understanding android 's code

2009-02-11 Thread Meryl Silverburgh
Hi, When I create a button, it has a grey round rectangle and an orange background when it has focus. Can you please tell me where is the code which draws that? I looked at the method of onDraw() of View and button, i dont' see that is drawing that. And in the TextView, I don't it is drawing

[android-developers] How to customize android button's look and feel

2009-02-11 Thread Meryl Silverburgh
Hi, Can you please tell me how can I customize android button's look and feel? e.g. by default, it uses a grey round rectangle as the border and it has 'orange' background when it has focus. Can you please tell me how can i config that in my application? Thank you.

[android-developers] Re: How to customize android button's look and feel

2009-02-11 Thread Meryl Silverburgh
I found the 'btn_default_selected.9.png' 'btn_default_press.9.png' images, but I am still not sure how the 'borders' are drawn. Thank you for any tip. On Wed, Feb 11, 2009 at 11:20 AM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, Can you please tell me how can I customize android

[android-developers] Question about Bottom left/right strip in the TabWidget

2009-02-10 Thread Meryl Silverburgh
Hi, In the TabWidget source code, it has a mBottomLeftStrip and mBottomRightStrip attribute. Can you please tell me what are they for? I have an android example with Tab. When I run that in the emulator, I click the left/right of the tab widget, I don't see anything happened. Thank you for any

[android-developers] Re: Cannot delete that URL exception

2009-02-09 Thread Meryl Silverburgh
, 3:19 am, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, I am getting the Cannot delete that URL exception(see below): java.lang.UnsupportedOperationException: Cannot delete that URL: content://contacts/phones at android.database.DatabaseUtils.readExceptionFromParcel

[android-developers] Unit testing context.sendBoardcast function

2009-02-08 Thread Meryl Silverburgh
Hi, I have the following test case which tests context.sendBoardcast() function: public void testInstallFavorite() { Context context = getContext(); IntentFilter filter = new IntentFilter();

[android-developers] Cannot delete that URL exception

2009-02-08 Thread Meryl Silverburgh
Hi, I am getting the Cannot delete that URL exception(see below): java.lang.UnsupportedOperationException: Cannot delete that URL: content://contacts/phones at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:130) at

[android-developers] Re: How to programmically add a new contact in android

2009-02-06 Thread Meryl Silverburgh
That line is after my first insert. On Fri, Feb 6, 2009 at 4:23 AM, MichaMicha micha.okker...@gmail.com wrote: values.clear(); doesn't look right, right? On 6 feb, 08:30, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, I am trying to programmically add a new contact in android

[android-developers] How to remove a contact with a specified phone number?

2009-02-06 Thread Meryl Silverburgh
How to remove a contact with a specified phone number? I try this: String phone =1234567; context.getContentResolver().delete(Contacts.Phones.CONTENT_URI, phone, null); But I get an error with this: java.lang.UnsupportedOperationException: Cannot delete that URL: content://contacts/phones

[android-developers] What is the difference between managedQuery() and getContentREsolver().query()

2009-02-05 Thread Meryl Silverburgh
I have read: http://code.google.com/android/devel/data/contentproviders.html But I don't understand what is the difference between managedQuery() and getContentREsolver().query()? Seems to me both take a Uri and query parameters and then return a Cursor. I appreciate if anyone can tell me the

[android-developers] How can i find out what is the top 'view' of my activity?

2009-02-05 Thread Meryl Silverburgh
Hi, Is it possible for me to find out what is the 'view' of my activity? e.g. if my activity pops up a 'dialog', can I get a reference of that dialog? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[android-developers] How to programmically add a new contact in android

2009-02-05 Thread Meryl Silverburgh
Hi, I am trying to programmically add a new contact in android. What I did is this: Uri uri = Contacts.People.CONTENT_URI; values.put(Contacts.PeopleColumns.NAME, mydummyuser1); Uri newuri = myActivity.getContentResolver().insert(uri, values);

[android-developers] How to instrumentation clicking a button of dialog?

2009-02-04 Thread Meryl Silverburgh
Hi, In my activity, I have code which create dialog like this with +ve and -ve button each has its own click action: protected Dialog onCreateDialog(int id) { switch (id) { case CONFIRM_DIALOG: // create my own dialog with positive and negative button...

[android-developers] How to call callActivityOnRestoreInstanceState of Instrumentation

2009-02-04 Thread Meryl Silverburgh
Hi, I have the following test code which calls callActivityOnRestoreInstanceState of Instrumentation class. mStartIntent = new Intent(Intent.ACTION_MAIN); Bundle bundle = new Bundle(); bundle.putBoolean(testProperty, false); MyActivity

[android-developers] Re: How to call callActivityOnRestoreInstanceState of Instrumentation

2009-02-04 Thread Meryl Silverburgh
{ public ApiDemosTest() { super(com.example.android.apis, ApiDemos.class); } } In either case, a clue that something is wrong is that you're calling both startActivity() *and* callActivityOnStart(), which cannot be right. --Andy On Wed, Feb 4, 2009 at 4:50 PM, Meryl Silverburgh