1
我有一個應用程序(com.example.MyApplication)的sharedPreferences節省了當前的位置這樣檢索另一個應用程序
SharedPreferences settings = getSharedPreferences(PREFERENCES, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("City", city);
editor.commit();
現在我想使其它應用程序(com.example.SecondApplication)和檢索來自其他應用程序的城市字符串,我該怎麼做?
如果MyApplication不存在,SecondApplication會做什麼?或存在一段時間,然後卸載? – CommonsWare 2012-08-14 19:22:50
我認爲共享首選項只能在同一應用程序中訪問,而不能在任何其他應用程序中訪問。 – 2012-08-14 19:25:46
當我試圖城市我會做一個if語句,如果city == null,那麼我會顯示一條消息,說城市沒有保存 – DoubleP90 2012-08-14 19:26:54