Question: I am getting response as array. I am manipulating that to get particular value from each array element.

Actual response:

[![enter image description here](https://i.stack.imgur.com/54hTd.png)](https://i.stack.imgur.com/54hTd.png)

When I do

```
 //carb_value is a array that contain the above response

  var l = this.carbs_value.length;
  for (var i = 0; i < l; i++) {
  console.log(this.carbs_value[i]);
  }

```

I am getting :

[![enter image description here](https://i.stack.imgur.com/cuZ9z.png)](https://i.stack.imgur.com/cuZ9z.png)

what i need is, select particular value from each element of an array like

```
0: { carbs: 30}
1: { carbs: 25}

```

Answer: 
To disable recreations of DialogFragments of a specific type, you can override `onCreate` in your derived `DialogFragment` class and dismiss the dialog in case it is being recreated:

```
public class MyDialogFragment extends DialogFragment
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        if (savedInstanceState != null)
        {
            dismiss();
        }
    }
    ...

```
As @Luksprog mentioned in the comments, a solution could be:

Give a tag to your DialogFragment at creation:

```
FragmentManager fragmentManager = getSupportFragmentManager();
MyDialogFragment.newInstance(...).show(fragmentManager, "myTag");

```

Search for it and dismiss it in `onCreate`

```
MyDialogFragment dialog = ((MyDialogFragment)getSupportFragmentManager().findFragmentByTag("myTag"));
if (dialog != null) {
    dialog.dismiss();
}

```

I think it would be more efficient to disable the recreation of the DialogFragment altogether but I don't know if that's possible.