I have two android:id .
For example: [ R.id.custom_font ] and [ R.id.product_name ]
In .java file
TextView tv = (TextView)findViewById(R.id.custom_font);
Typeface cFont = Typeface.createFromAsset(getAssets(), "fonts/jcc.ttf");
tv.setTypeface(cFont);
// Adding items to listview
adapter = new ArrayAdapter<String>(this, R.layout.list_item, R.id.product_name, products);
lv.setAdapter(adapter);
When I put them together in a single text view it shows an error message [Attribute “android:id” was already specified for element “TextView”]
In .xml file
<TextView
android:textColor="?android:textColorPrimary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/custom_font"
android:id="@+id/product_name" //Attribute "android:id" was already specified for element "TextView"
android:textSize="15sp" />
How can I pass the two android:id in a single text view?
Thanks in advance.
No, it is not possible. You can have only one
android:idassociated with one component.