# View doesn't update in android 6.0.1, but it works normally in android 5.0

**URL:** <https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212>\
**Category:** ionic-v3\
**Created:** [January 24, 2018, 4:57am UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212 "2018-01-24T04:57:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![richguo](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@richguo](https://forum.ionicframework.com/u/richguo)\
**Post date:** [January 24, 2018, 4:57am UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/1 "2018-01-24T04:57:44Z")

</div>

Hello Guys -

I am having a Problem with my View not beeing updated properly on my Ionic2 android App.  
This problem appear in Android 6.0.1, but not appear in Android 5.0.

I tried ApplicationRef.tick() , NgZone.run(callback), ChangeDetectorRef.detectChanges(), and these can’t solve the problem. (Android 6.0.1)

View does not update util I **touch somewhere of screen, or trigger a select…etc**.

here is my view

 ![46](https://global.discourse-cdn.com/ionicframework/original/3X/7/7/77a3dd7c629a48845abd67c82a00a433826d9690.png)

util I touch somewhere or trigger select, it show data immediately.

 ![31](https://global.discourse-cdn.com/ionicframework/original/3X/f/2/f2a5edbb8f6bf64686e96838df62d6c9e13c2e28.png)

and here is my sample code:

 ![1516713792321](https://global.discourse-cdn.com/ionicframework/original/3X/6/f/6fb84d30ad2688ab47443c88d3becc2c6389794c.jpg)

 ![1516713847808](https://global.discourse-cdn.com/ionicframework/original/3X/b/7/b7b7045fc78eaba625d08b9d171f073088ccb916.jpg)

My Package:  
“dependencies”: {  
“@angular/common”: “5.0.0”,  
“@angular/compiler”: “5.0.0”,  
“@angular/compiler-cli”: “5.0.0”,  
“@angular/core”: “5.0.0”,  
“@angular/forms”: “5.0.0”,  
“@angular/http”: “5.0.0”,  
“@angular/platform-browser”: “5.0.0”,  
“@angular/platform-browser-dynamic”: “5.0.0”,  
“@ionic-native/camera”: “^4.4.2”,  
“@ionic-native/core”: “4.3.2”,  
“@ionic-native/file”: “^4.3.1”,  
“@ionic-native/file-transfer”: “^4.4.2”,  
“@ionic-native/in-app-browser”: “^4.4.2”,  
“@ionic-native/splash-screen”: “4.3.2”,  
“@ionic-native/status-bar”: “4.3.2”,  
“@ionic/storage”: “2.1.3”,  
“cordova-android”: “^6.3.0”,  
“cordova-ios”: “^4.5.0”,  
“cordova-plugin-camera”: “^2.4.1”,  
“cordova-plugin-compat”: “^1.2.0”,  
“cordova-plugin-device”: “^1.1.4”,  
“cordova-plugin-file”: “^4.3.1”,  
“cordova-plugin-file-transfer”: “^1.6.1”,  
“cordova-plugin-inappbrowser”: “^1.7.2”,  
“cordova-plugin-ionic-webview”: “^1.1.16”,  
“cordova-plugin-splashscreen”: “^4.0.3”,  
“cordova-plugin-statusbar”: “^2.2.2”,  
“cordova-plugin-whitelist”: “^1.3.3”,  
“ionic-angular”: “nightly”,  
“ionic-plugin-keyboard”: “^2.2.1”,  
“ionicons”: “3.0.0”,  
“rxjs”: “5.5.2”,  
“sw-toolbox”: “3.6.0”,  
“zone.js”: “0.8.18”  
},  
“devDependencies”: {  
“@ionic/app-scripts”: “nightly”,  
“typescript”: “2.4.2”  
},

ionic info:  
cli packages: (/usr/local/lib/node\_modules)

```
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1

```

global packages:

```
cordova (Cordova CLI) : 7.0.1 

```

local packages:

```
@ionic/app-scripts : 2.1.4
Cordova Platforms : android 6.2.3 ios 4.5.0
Ionic Framework : ionic-angular 3.9.2

```

System:

```
Node : v6.11.4
npm : 3.10.10 
OS : macOS Sierra
Xcode : Xcode 9.0 Build version 9A235 

```

Environment Variables:

```
ANDROID_HOME : not set

```

Misc:

```
backend : pro

```

Thanks for your answers 🙂

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [January 24, 2018, 7:55am UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/2 "2018-01-24T07:55:05Z")

</div>

Remove the change detection thing firstly.

Swap round the this.showSpinner=false and this.offices = data.json lines.

On your ion-card add on \*ngIf=“!showSpinner”

_Additionally_  
You would do yourself a favour by using proper type safety for your objects, no one would have a clue what fields are available inside this.offices by just looking.

---

<div class="post-metadata">

**Author:** ![richguo](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@richguo](https://forum.ionicframework.com/u/richguo)\
**Post date:** [January 24, 2018, 10:59am UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/3 "2018-01-24T10:59:55Z")

</div>

@Judgewest2000, thanks for your help. but it seems not work. and I find a post like my problem.

> [@Ionic-tabs content only loading for first tab and dissappears when changing tabs](https://forum.ionicframework.com/t/ionic-tabs-content-only-loading-for-first-tab-and-dissappears-when-changing-tabs/5765/3):
>
> Hi I also face the same problem. i access data from database in controller and display it in ionic tab view using ng-repeat but when I navigate to tab data is not loaded and when i click that tab again then data displays. So I have to double click on tab to display data. So please tell me how to load data in single click on tab. I am new to ionic so please help me.

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [January 24, 2018, 11:37am UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/4 "2018-01-24T11:37:36Z")

</div>

you could also add after the this.showSpinner=false line a simple…

```auto
alert('this part has been actioned');

```

Just to try and work out if that is executing as you’d expect and not when you touch the screen for example.

Not saying that’ll resolve your issue, but you might learn something.

---

<div class="post-metadata">

**Author:** ![richguo](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@richguo](https://forum.ionicframework.com/u/richguo)\
**Post date:** [January 24, 2018, 11:45am UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/5 "2018-01-24T11:45:12Z")

</div>

Yes, and I tried alert(‘something’), it’s will update view immediately. but if I don’t trigger alert, or select …etc. first tab does not update view until I trigger something.

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [January 24, 2018, 12:30pm UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/6 "2018-01-24T12:30:29Z")

</div>

hum…

try putting it like this…

```auto
   this.offices = data.json();
   setTimeout(() => this.showSpinner = false, 100);

```

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [January 24, 2018, 1:48pm UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/7 "2018-01-24T13:48:33Z")

</div>

Your app-scripts is old. So are your Node and npm, but app-scripts would be the priority to update.

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [January 24, 2018, 1:51pm UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/8 "2018-01-24T13:51:44Z")

</div>

I don’t know what is causing your problem, but I’ve had unpredictable behavior when I put a directive on an ion-card. Now I do things like this:

```auto
<div *ngIf="">
  <ion-card>
  </ion-card>
</div>

```

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:54pm UTC](https://forum.ionicframework.com/t/view-doesnt-update-in-android-6-0-1-but-it-works-normally-in-android-5-0/119212/9 "2021-07-19T21:54:06Z")

</div>

Closed on July 19, 2021, 9:54pm UTC


