是否需要在Fragment的onDestroy()中将ViewBinding设置为null?有时我在教程中看到这个东西。真的有必要吗?
几个月前,我的谷歌登录程序工作没有问题,但今天模拟器在 Logcat 中回复我这个错误:
\nE/Auth:[GoogleAccountDataServiceImpl] getToken() -> NEED_REMOTE_CONSENT。应用程序:com_pro.bandweb.mycpstore,服务:oauth2:email https://www.googleapis.com/auth/spreadsheets.readonly openid 配置文件
\n尝试在谷歌中查找,但我没有找到任何建议...这是我用于 sigIn 的代码:
\npublic void InitGoogle() throws IOException {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestScopes(new Scope(SPREADSHEETS_SCOPE))\n .requestEmail()\n .build();\n googleSignInClient = com.google.android.gms.auth.api.signin.GoogleSignIn.getClient(this, gso);\n\n if (GoogleSignIn.getLastSignedInAccount(this) == null) {\n Log.v(TAG, "getting sign-on again");\n //startActivityForResult(googleSignInClient.getSignInIntent(), RC_SIGN_IN);\n SignInActivityResult.launch(googleSignInClient.getSignInIntent());\n } else {\n Log.v(TAG, "sign-on is still good, reusing");\n\n //faccio la richiesta solo se \xc3\xa8 stato inserito il foglio di google shhet nelle preferenze, altrimenti avviso\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n if (!sharedPreferences.contains(getString(R.string.pref_googleSheetId_key))\n || …Run Code Online (Sandbox Code Playgroud) 我有一些android项目,我经常使用RecyclerView(如果重要的话,它是带有androidx前缀的小部件)而不添加任何依赖项。但是当我查看另一个项目的 gradle 文件(甚至是由 Google 开发的)时,我看到了这种依赖关系:
implementation "androidx.recyclerview:recyclerview:$recycler_view_version"
Run Code Online (Sandbox Code Playgroud)
所以,我有疑问。