Search code examples
androidsharedpreferencesaccessibilityaccessibilityservice

Convert String to AccessibilityNodeInfo in android


I'm working with accessibility in android. I've one doubt that I've tried searching google and stack over flow. but I can't get it.

The problem is, when I'm focusing the edit text field I can get the source of a edit text field by using event.getSource() and I stored the retrieved source to locally by using SharedPreference. Then, I get stored source of AccesssibilityNodeInfo from SharedPreference as a string.

So I've the source of a AccesssibilityNodeInfo as a string that needs to be converted as a AccesssibilityNodeInfo.

How it's possible? I've tried some normal conversion but its not possible. Thanks.


Solution

  • There is no available method to do this, you'll have to parse it yourself. It would probably be easier to store the pieces you need separately, if indeed storing it as a shared preference is necessary at all...