Reputation: 868
I have a Edittext, a button and a ListView in my activity. Now when any of the options on listview are selected i want to replace everything by a webview and if the user presses back i want to come back to the original view. How do i do this? I looked at View flipper but that is mostly used if you switch between views a lot, also is it a good idea to use webview with viewflipper.
Upvotes: 0
Views: 97
Reputation: 5542
You could use the visiblity of the views, so setup a webview that fills the screen then set its visibility to gone in your xml, then when you want to display it use myView.setVisibility(View.VISIBLE);
in your code to display the webview, it would probable be a good idead to make your buttons etc invisible using myView.setVisibility(View.GONE);
It would however be easier just to setup another activity with your webview in and just start that activity when required.
Upvotes: 1
Reputation: 681
In view method of item Listener of your code do something like this...
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("Web link here"));
and you are done with it...
Or please post your code so I can help you in better manner...
Upvotes: 0