Is it possible to use com.android.phone.EditPhoneNumberPreference widget in my app

by MathiasL » Fri, 10 Sep 2010 00:22:19 GMT


Sponsored Links
 I just realized i might have posted this question in the wrong group,
hence I try again.


I'm writing an app where the user should be able to enter a phone
number, or choose one from Contacts.

I've found a preference widget that does exactly what I want. The
problem is that I don't know how to use it in my app.
Is it even possible?

The widget I'm talking about is
com.android.phone.EditPhoneNumberPreference

I found it browsing the source at source.android.com
in [platform/packages/apps/Phone.git] / res / xml /
call_feature_setting.xml

<PreferenceScreen android:key="button_voicemail_setting_key"
     android:title="@string/voicemail_settings"
     android:persistent="false">

     <!-- Note for all com.android.phone.EditPhoneNumberPreference
objects

    The last several attributes are for use with the EditText field
    in the dialog.  These attributes are forwarded to that field
    when the edittext is created.  The attributes include:
      1. android:singleLine
      2. android:autoText
      3. android:background -->

       <com.android.phone.EditPhoneNumberPreference
         android:key="button_voicemail_key"
         android:title="@string/voicemail_settings_number_label"
         android:persistent="false"
         android:dialogTitle="@string/voicemail"
         phone:confirmMode="confirm"
         android:singleLine="true"
         android:autoText="false" />
</PreferenceScreen>

Since I'm quite lazy I prefer to reuse existing code instead of
rewriting things myself.

Is there a way to accomplish the above without duplicating the
EditPhoneNumberPreference functionality in a custom preference?

/Mathias

--



Other Threads

1. Default SMS Activity Result code coming as RESULT_CANCELED even SMS is received successfully

2010/07/21 13:41 "Amit" <amitmishr...@gmail.com>:


> 

2. Help: service auto restarts on breakpoint when debugging a service

I am trying to run the sample soft keyboard included in the SDK. I am
using the de{*filter*}, and the literature says that to use a breakpoint
while debugging a SERVICE, I need to include:

android.os.Debug.waitForDe{*filter*}();

So here is the portion of the code I modified:

@Override public void onCreate() {
                                                             /* now let's
wait until the de{*filter*} attaches */
       android.os.Debug.waitForDe{*filter*}();

 
super.onCreate();                                                               
                         //
breakpoint 1
        mWordSeparators =
getResources().getString(R.string.word_separators);       //
breakpoint 2
    }

I have put a couple of breakpoints, at the statements indicated by the
comments.

This is what happens: the de{*filter*} first stops at the breakpoint1, for
a few seconds. But then the service restarts. For the life of me I
can't figure out what makes the service to restart.

Any ideas?

Thanks.

-- 

3. CTS API Demos test case

4. Audiotrack buffer issues?

5. Android Developer, San Francisco, C

6. Seach suggestions with MatrixCursor no longer work in 2.2

7. Cannot get Level-List Drawable to work in ListAdapter