更新时间:2023-01-13 11:44:07
您需要的应用程序上下文来访问共享preferences。它应该是:
You need the application Context to access the shared preferences. It should be:
cd.setVarA(true,this.getApplicationContext());
在的onCreate MyActivity 的
的onCreate
MyActivity
如何通过(Android版)应用程序上下文Java类?