Add Words to Android's UserDictionary

前端 未结 3 867
逝去的感伤
逝去的感伤 2020-12-08 11:25

I want to add an entire medical dictionary to my android phone (Moto Droid). I would like to be able to send text messages and have the medical words be in the predictable t

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 11:46

    mm mm where UserDictionary is defined? maybe you should just

    UserDictionary = new UserDictionaryType();
    UserDictionary.Words = new WordsType();
    

    OR define in the class just under the class declaration the fallowing :

     static UserDictionaryType UserDictionary;
    

    if that's the case it's obvious why your app crashed ... (do it on kernel mode and "Houston we got a problem" you cant access pointer that you didnt allocated memory for even in java which is managed code... )

    but again I am not familiar with your code show us where it defined and I would try to help you more ...

    EDIT1: even if UserDictionary exists in the API you didn't declare on one... you should declare somewhwere static UserDictionary ud = new UserDictionary();

提交回复
热议问题