how to combine try in the if condition : <p>first code</p>

<pre><code>try {
        InputStream is = getAssets().open("read_asset.txt");
        int size = is.available();
        byte[] buffer = new byte[size];
        is.read(buffer);
        is.close();
        String text = new String(buffer);
        TextView tv = (TextView)findViewById(R.id.text);
        tv.setText(text);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
</code></pre>

<p>and this second code</p>

<pre><code>if(txtweb.getText().toString().equals("Google Plus")) {
        setContentView(R.layout.google);


    } else if(txtweb.getText().toString().equals("Twitter")){
        setContentView(R.layout.google);
    }
</code></pre>

<p>i want to combine try code into if condition , please help</p>
