Q:

How to put a POST response in a tab of String?

I am using retrofit2 and I am getting a POST response in a format stated bellow. I am trying to put every line in its own tab bracket.
This is a response format:
aaaa
bb
cc
dd
I am trying to make it like this:
String[] tab = {"aaaa", "bb", "cc", "dd"};

This is my code:
protected void onActivityResult(int requestCode, int resultCode, Intent data){
    IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
    if(result != null){
        if(result.getContents()==null){ //ce prekinemo skeniranje
            Toast.makeText(this, "Scann canceled!", Toast.LENGTH_LONG).show();
        }
        else{
            ...//here I want to put response into my tab

A:

This is the line of code you are looking for!
String[] tab = result.getContents().split(System.getProperty("line.separator"));

