Retrieving query parameters

suggest change
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");
        }
    }

}

If the user clicks on a linkto http://www.example.com/map?param1=FOO&param2=BAR, then param1 here will have a value of "FOO" and param2 will have a value of "BAR".

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents