Buggy code:
public class BrowserActivity extends Activity implements BrowserController { private static final int DOUBLE_TAPS_QUIT_DEFAULT = 2000 ; private SwitcherPanel switcherPanel ; private float dimen156dp ; private float dimen144dp ; private float dimen117dp ; private float dimen108dp ; private float dimen48dp ; private HorizontalScrollView switcherScroller ; private LinearLayout switcherContainer ; private RelativeLayout omnibox ; private TextView inputBox ; private ImageView omniboxOverflow ; private ProgressBar progressBar ; private RelativeLayout searchPanel ; private EditText searchBox ; private FrameLayout contentFrame ; private class VideoCompletionListener implements MediaPlayer . OnCompletionListener , MediaPlayer . OnErrorListener { @ Override public boolean onError ( MediaPlayer mp , int what , int extra ) { } @ Override public void onCompletion ( MediaPlayer mp ) { } } private FullscreenHolder fullscreenHolder ; private View customView ; private VideoView videoView ; private int originalOrientation ; private CustomViewCallback customViewCallback ; private ValueCallback < Uri > uploadMsg = null ; private ValueCallback < Uri [ ] > filePathCallback = null ; private boolean create = true ; private int shortAnimTime = 0 ; private int mediumAnimTime = 0 ; private int longAnimTime = 0 ; private AlbumController currentAlbumController = null ; @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent intent ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } private void initSwitcherView ( ) { } private void initOmnibox ( ) { } private void initHomeGrid ( final NinjaRelativeLayout layout , boolean update ) { } private void initSearchPanel ( ) { } private synchronized void addAlbum ( String title , final String url , final boolean foreground , final Message resultMsg ) { } private synchronized void pinAlbums ( String url ) { } @ Override public synchronized void showAlbum ( AlbumController controller , boolean anim , final boolean expand , final boolean capture ) { } private synchronized void updateAlbum ( ) { } private synchronized void updateAlbum ( String url ) { } @ Override public synchronized void removeAlbum ( AlbumController controller ) { } @ Override public void updateInputBox ( String query ) { } private void updateOmnibox ( ) { } @ Override public synchronized void updateProgress ( int progress ) { } @ Override public void onCreateView ( WebView view , final Message resultMsg ) { } @ Override public boolean onShowCustomView ( View view , int requestedOrientation , WebChromeClient . CustomViewCallback callback ) { } @ Override public boolean onShowCustomView ( View view , WebChromeClient . CustomViewCallback callback ) { } @ Override public boolean onHideCustomView ( ) { } private boolean onKeyCodeVolumeUp ( ) { } private boolean onKeyCodeVolumeDown ( ) { } private boolean onKeyCodeBack ( boolean douQ ) { } private void hideSoftInput ( View view ) { } private void showSoftInput ( View view ) { } private void hideSearchPanel ( ) { } private void showSearchPanel ( ) { } private boolean prepareRecord ( ) { } private void setCustomFullscreen ( boolean fullscreen ) { } private AlbumController nextAlbumController ( boolean next ) { } @ Override protected void onNewIntent ( Intent intent ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } @ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { } @ Override public boolean onKeyUp ( int keyCode , KeyEvent event ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onDestroy ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { int id = item . getItemId ( ) ; if ( id == ( id . action_open ) ) { <START_BUG> Uri uri = Uri . parse ( inputBox . getText ( ) . toString ( ) ) ; <END_BUG> Intent it = new Intent ( Intent . ACTION_VIEW , uri ) ; startActivity ( it ) ; } else if ( id == ( id . action_refresh ) ) { if ( ( currentAlbumController ) == null ) { NinjaToast . show ( this , toast_refresh_failed ) ; } if ( ( currentAlbumController ) instanceof NinjaWebView ) { NinjaWebView ninjaWebView = ( ( NinjaWebView ) ( currentAlbumController ) ) ; if ( ninjaWebView . isLoadFinish ( ) ) { ninjaWebView . reload ( ) ; } else { ninjaWebView . stopLoading ( ) ; } } else { NinjaToast . show ( this , toast_refresh_failed ) ; } } else if ( id == ( id . action_exit ) ) { finish ( ) ; } return super . onOptionsItemSelected ( item ) ; } }

Fix:
Uri uri = Uri . parse ( ( ( NinjaWebView ) ( currentAlbumController ) ) . getUrl ( ) ) ;