i am new to android and i am working on preference headers. i have few queries on preferences. here are they
Can preference headers and preference switch can be on same page. eg, first two options will be wifi and bluetooth as preference headers. On clicking on any of them should lead to new preference screen. Third option should be switch preference which should be worked only for ON and OFF of switch. touch click on the switch reference shouldn't launch new preference screen. I tried to add a switch preference in class along with onbuildheaders, It is not working.
should preference header always linked with a fragment to open a new preference screen?? can a preference header created without fragment?
does preference header will have touch sensitivity by default??
can we disable new preference screen which will be opened after tapping on the preference header. eg. bluetooth is preference header which has ON/OFF switch. if switch is ON, it will enable bluetooth and if it is OFF, bluetooth should be disabled. Tapping on bluetooth header should nt open preference.
Here is XML file ` headers.xml
<preference-headers
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Header1 -->
<header
android:id="@+id/Header1"
android:fragment="com.android.Headers.header1"
android:title="@string/Header1"
<!-- Header2 -->
<header
android:id="@+id/Header2"
android:fragment="com.android.Headers.header2"
android:title="@string/Header2"
<!-- Header3-->
<header
android:id="@+id/Header3"
android:title="@string/Header3" />
</preference-headers>`
Here am loading Headers
public void onBuildHeaders(List headers) { loadHeadersFromResource(R.xml.headers, headers);