1
假設我有一個設備使用2個Gmail帳戶登錄。 [email protected] & [email protected]。 我創建了一個頁面來檢索所有活動的Gmail,並允許用戶選擇使用哪一個。 但是,在用戶決定使用哪個電子郵件後,我應該如何處理所選帳戶?當多個gmail活動時處理C2DM註冊
除了執行下面的代碼外,還應該做些什麼?
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); // boilerplate
registrationIntent.putExtra("sender", roleEmail);
startService(registrationIntent);
我也看了看ChromeToPhone樣本的基礎上,他們的代碼,所選擇的帳戶名被保存到我不明白爲什麼SharedPreferences。
是的,我知道我需要使用roleEmail(註冊,並通過谷歌的C2DM白名單的電子郵件)。 – root 2012-04-27 14:44:32
然後請標記爲已回答:)除非您有更精確的問題... – Warpzit 2012-04-28 14:58:07