'Android : Failed writing handshake bytes (-1 of 14): Broken pipe

Bascially i'm trying to add the back functionality using (MinSDK is set to 11)

getActionBar().setDisplayHomeAsUpEnabled(true);

Here are is my function:

public class DetailActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.detail_layout);
    getActionBar().setDisplayHomeAsUpEnabled(true);


}

The Logcat Details:

07-28 18:26:50.030  19793-19795/? E/art﹕ Failed writing handshake bytes (-1 of 14): Broken pipe


Solution 1:[1]

Instead of getActionBar() try this: getSupportActionBar().setDisplayHomeAsUpEnabled(true)

Solution 2:[2]

Try adding AppCompactActivity in place of ActionBarActivity.

And change the function getActionBar  to getSupportActionBar

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Trimax
Solution 2 Tomerikoo