1

I used wizard Android for créate Settings Activity my app. I have added a custom layout, nothing unusual, simply a background and border.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@mipmap/fondo_01">
<ListView android:id="@android:id/list"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/corners_main_layout"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    android:layout_marginTop="16dp"
    android:paddingLeft="16dp" />
  </RelativeLayout>

In method onBuildHeaders i add setcontentView, all ok...:

 @Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void onBuildHeaders(List<Header> target) {
    loadHeadersFromResource(R.xml.pref_headers, target);
    setContentView(R.layout.config_custom);

The following XML is for the Header:

<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">

<!-- These settings headers are only used on tablets. -->

<header
    android:fragment="com....."
    android:icon="@drawable/ic_info_black_24dp"
    android:title="@string/pref_header_general" />

<header
    android:fragment="com...."
    android:icon="@drawable/ic_notifications_black_24dp"
    android:title="@string/pref_header_notifications" />

<header
    android:fragment="com......."
    android:icon="@drawable/ic_sync_black_24dp"
    android:title="@string/pref_header_data_sync" />

 </preference-headers>

"android:icon" add the icon to the left, but I need to add another to the right. How could it?

daicon
  • 181
  • 3
  • 15

0 Answers0