檢索查詢引數

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        Intent intent = getIntent();
        Uri data = intent.getData();

        if (data != null) {
            String param1 = data.getQueryParameter("param1");
            String param2 = data.getQueryParameter("param2");
        }
    }

}

如果使用者點選連結到 http://www.example.com/map?param1=FOO&param2=BAR,則 param1 此處的值為 FOOparam2 的值為 BAR