0

I want to use a resource id edittext_container which has been already defined in framework,

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@*android:id/edittext_container"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="5dip"
    android:orientation="vertical">

    <TextView android:id="@+android:id/message"
        style="?android:attr/textAppearanceSmall"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="?android:attr/textColorSecondary" />

</LinearLayout>

but the Eclipse build error:

Illegal resource reference: @*android resources are private and not always present

How to resolve?

This id is in http://androidxref.com/4.2.2_r1/xref/frameworks/base/core/res/res/layout/preference_dialog_edittext.xml

Victor S
  • 4,021
  • 15
  • 43
  • 54

2 Answers2

3

You cannot refer to Android private resources. But you can copy them and put it in your own project resource folder instead.

You can find all of them here https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r2.3/core/res/res/

However, these themes/styles might be nested and have deep dependencies. You need to extract a lot from the original files.

Robin
  • 10,052
  • 6
  • 31
  • 52
0

Maybe you should just write:

android:id="@android:id/edittext_container"

without the *

mvieghofer
  • 2,846
  • 4
  • 22
  • 51