ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

Nativescript app refreshes page when minimized and maximized #1482

Closed adekunle11 closed 3 years ago

adekunle11 commented 3 years ago

hope this meets you well.

I have this issue with my nativescript app, when the app is minimized and resumed, the page content reloads.

How can i stop that, i'm convinced it has something to do with my AndroidManifest.xml

An example of this issue is

I have a page with radlistview, when i minimize on this page and resume, the listivew reloads and goes back to 0 instead of the scrolling to continue from where it was before i minimized

AndroidMnaifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="__PACKAGE__"
    android:versionCode="1"
    android:versionName="1.0">

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"/>

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-feature android:name="android.hardware.camera" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <application
        android:name="com.tns.NativeScriptApplication"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        android:launchMode="singleInstance"
        android:requestLegacyExternalStorage="true"
        android:windowSoftInputMode="stateHidden | adjustPan">

        <activity
            android:name="com.tns.NativeScriptActivity"
            android:label="@string/title_activity_kimera"
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
            android:theme="@style/LaunchScreenTheme">

            <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="www.magnoliyan.com" />
            </intent-filter>
        </activity>
        <activity android:name="com.tns.ErrorReportActivity"/>
    </application>
</manifest>

Page.js

const HomeViewModel = require("./home-view-model");
exports.pageLoaded = function (args) {
  const page = args.object;
  const homeViewModel = new HomeViewModel();
  page.bindingContext = homeViewModel;
  page.bindingContext.initDataItems();
  page.bindingContext.addMoreItemsFromSource(8);
  statusBar.show();
}
adekunle11 commented 3 years ago

using navigatingTo event fixed it