Android open browser insted of change URL in WebView
===

Android open browser insted of change URL in WebView.

When user click item in ListFragment, updateUrl() is called:

	public void onListItemClick(ListView list, View view, int position, long id) {
		String content = europe.get(position).url;
		detailsFragment = (EuDetailsFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.eu_details_fragment);

		if(detailsFragment == null) {
			Intent intent = new Intent(getActivity(), EuDetailsActivity.class);
			intent.putExtra("uri", content);
			startActivity(intent);
		} else {
			detailsFragment.updateUrl(content);
		}
	}

----------

Here's my fragment where WebView is (R.layout.webview contain WebView only).

    package com.example.fragments;
    
    import android.os.Bundle;
    import android.support.v4.app.Fragment;
    import android.util.Log;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.webkit.WebView;
    
    public class EuDetailsFragment extends Fragment {
    	private WebView viewer;
    	
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
        }
    	
    	@Override
    	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    		viewer = (WebView) inflater.inflate(R.layout.webview, container, false);
    	
    		return viewer;
    	}
    	
    	public void updateUrl(String newUrl) {
    		Log.d("EuDetailsFragment", "Updating url...");
    		WebView detailsView = (WebView) getView().findViewById(R.id.detailsView);
    		detailsView.loadUrl(newUrl);
    	}
    }