Question: I have `Dictionary(Of List(Of Object), Integer)` and need to get my dictionary grouped by keys.

For example: 

```
Dictionary (0) = Key: {List(12, "SomeString", 3)} Value: 54

Dictionary (1) = Key: {List(8, "SomeAnotherString", 3)} Value: 6

Dictionary (2) = Key: {List(12, "SomeString", 3)} Value: 15

```

How can I get this `Dictionary` looks like:

```
Dictionary (0) = Key: {List(12, "SomeString", 3)} Value: 54, 15

Dictionary (1) = Key: {List(8, "SomeAnotherString", 3)} Value: 6

```

Answer: 
AsyncTask.execute() is a non-blocking call. You can't set the result to the Bundle and start an Intent immediatly after execute(). That's why you are getting a NPE in your second Activity because `sending` isn't initialized, so it's null.

Move the code to start a new Activity with the desired data in your callback:

```
  public void processFinish(String output){

        bnd.putString("veri", output);
        intent.putExtras(bnd);
        startActivity(intent);

   }

```

And make sure you call `delegate.processFinished(String)` if your data processing is finished. So move it out of the for loop. BTW `t` will only get the last "name"-String in the JSONArray. If you wanna get them all make `t` a String array and fill it.
As your variable `t` is globally declared in your activity so can directly use the value of `t` which you are assigning in your `onPostExecute()` method. Just you need to check for its null value only in your button click event as below :

> 
> 
> ```
>    b.setOnClickListener(new OnClickListener() {
>         @Override
>         public void onClick(View arg0) {
>         asyncTask.execute(true);
>          if(t != null || t != "")
>           {
>               bnd.putString("veri", t);
>               intent.putExtras(bnd);
>              startActivity(intent);
>          }
>       }
>      });
> 
> ```
> 
>