tags:

views:

94

answers:

1

I am trying to reuse the header layout for contact details display view.

I was able to add the widget of ContactHeaderWidget to my XML file as it is in this file and it shows up empty when I run the apk.

But now how do I set the name of the contact, and the image of the contact?

I've tried the method in line 197 here but I couldn't import the necessary files as that would be line 28, which is not available for me.

import com.android.internal.widget.ContactHeaderWidget;
+1  A: 

I don't think you can actually use anything in the com.android.internal package. This may have been possible in the past but doesn't seem possible now. When I've wanted to use things in com.android.internal before I've had to find the source and copy it to my project.

I believe the rationale behind making things under com.android.internal inaccessible was because these classes are subject to change, were only intended for internal OS use, and are not supported for use in 3rd party apps.

mbaird
So, if I want to implement the same design that is in ContactHeaderWidget, how do I proceed?
Pentium10
Like I said, you may have to grab the source and make your own ContactHeaderWidget class. http://github.com/android/platform_frameworks_base/blob/2e14ef048564b7b78aa7a4c057b1f3321de73038/core/java/com/android/internal/widget/ContactHeaderWidget.java
mbaird