![](/img/trans.png)
[英]Android: Intent Extras not passed with startActivity() outside Activity context
[英]startActivity and intercept intent extras
我正在考慮為登錄用戶執行以下操作:
Intent intent= new Intent(this,DoLoginActivity.class);
intent.putExtra("login",mLogin);
intent.putExtra("password",mPassword);
startActivity(intent);
這樣安全嗎,還是其他應用可以輕松聽/讀意圖參數?
您當前的方法是安全的,沒有其他應用程序可以監聽或讀取這些值。
您正在使用Explicit intent [you actually specify the activity that is required to respond to the intent]
並且僅由Intent中聲明的類偵聽。 所以這是安全的。
對於您的信息,您可以通過意圖傳遞對象,這將在傳遞一堆值的情況下提供幫助。 鏈接
為了增強安全性,應該將密碼存儲在char數組(char [])中,然后在使用后通過清除數組來清除密碼,如下所示:
Arrays.fill(password, (char) 0);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.