    

 ## On this page

  

 

 # setPreference

 Last update: 30.07.2026 

public [setPreference](set-preference.md)(prefName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), value: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))

Sets a preference

#### Parameters

prefNamethe name of the preferencevaluethe new preference value