簡體   English   中英

Intent構造函數中的uri參數到底是什么?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM