How to manage custom preference layout

前端 未结 2 1298
南笙
南笙 2021-01-03 01:50

I have a custom preference with an image and two text and I need to change the image programmatically.

I am able to get the custom preference view and to find the Im

2条回答
  •  心在旅途
    2021-01-03 02:02

    What if you put all images under res/drawable and then access them through R.drawable. ? This approach has always worked for me. If you don't have compelling reasons for using URI this approach might be worth trying. Even if you have to use URI I would suggest to test this approach and get it working. Then at least you would know that there is something wrong with the value of the 'path' and not your implementation in general.

提交回复
热议问题