PixelPW
PixelPW

Reputation: 143

Manipulate a URL with a spinner

I want to choose an item out of the spinner. And then it should open an URL in the Webview which only changes one number in the base URL. How does this work?

Upvotes: 1

Views: 148

Answers (2)

Octavian Helm
Octavian Helm

Reputation: 39605

Here is the basic idea.

You implement an OnItemSelectedListener by extending it. Inside of this listeners onItemSelected() method you just manipulate your string appropriately and start your other activity.

Here is an example on how to work with a Spinner.

Upvotes: 1

Rich
Rich

Reputation: 36836

Get the value from the Spinner with

getSelectedItem.toString()

Build your url with

String.format()

And update your webview with

WebView.loadUrl()

Upvotes: 0

Related Questions