[英]Android - What are exactly are you passing to the constructor of an intent when creating an explicit intent
[英]What exactly is the uri parameter for in the Intent constructor?
我嘗試過搜索網絡並瀏覽Google的文檔,但是我一直在努力尋找能夠解釋其用途的任何內容或顯示將其傳遞給構造函數的任何示例。
它設置您要對Intent進行操作的數據。 這與調用默認構造函數new Intent()
和然后調用setData(uri)
。
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(i);
這將啟動ACTION_VIEW
目的以查看Google網頁。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.