Question: i want to post the username from angular to asp.net web api.
my post method from server is :

```
 [Route("CheckUserName")]
    [AllowAnonymous]
    [HttpPost]
    public async Task<IHttpActionResult> CheckUsernameExist([FromBody] string username){ //return true or false}

```

and in angular 

```
checkUserName(userName: string) {
return this.http.post(
  `${this.appConfig.apiEndpoint}/${CHECK_USER_NAME}`,{userName})
  .pipe(map(res => res['result']['status'] as boolean));}

```

{userName} is data for send to server
but server side receive null
i test also data : 

```
userName,
{username:userName},
'"'+userName+'"',
,...

```

---

```
  checkUserName(userName: string) {
const headers = new HttpHeaders();
headers.append('Content-Type', 'application/json');
return this.http.post(
  `${this.appConfig.apiEndpoint}/${CHECK_USER_NAME}`, { userName },{ headers: headers })
  .pipe(map(res => res['result']['status'] as boolean));

```

}

i also test with postman and get data on server side correctly
[![postman test](https://i.stack.imgur.com/CUMcn.png)](https://i.stack.imgur.com/CUMcn.png)

Answer: 
You can't access adapter from your MainActivity, send you Contact data to the other Activity by using Intent's(putExtra) and use adapter.addContact() there.
Create a method in your activity like

```
public void showData(List<Contact> allContacts) {
    //here you can show the data received from main activity
    this.addContacts.addAll(allContacts);
    adapter.notifyDataSetChanged();
}

```

you can call this method from `MainActivity` when you have data