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;
开发者_开发百科
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.
精彩评论