Google Drive SDK Error

前端 未结 1 1233
野趣味
野趣味 2021-01-24 07:17

This is my code to access Google Drive, taken largely from ArtOfWarfare in this post:

public class MainActivity extends Activity {
    class OnT         


        
相关标签:
1条回答
  • 2021-01-24 08:01

    Try replacing this:

    am.getAccounts()[0],
    

    with this:

    am.getAccountsByType("com.google")[0],
    

    My code in the other topic was over simplified to assume that the first account it found would be a Google Account (and so have a Google Drive). The code we actually used in the app checked to make sure it was a Google Account (and then performed further checks to make sure it was a company account, which is why I simplified the code to what I shared.)

    0 讨论(0)
提交回复
热议问题