0
0
0ralo2019-11-13 19:03:16
Android
0ralo, 2019-11-13 19:03:16

Why does it work once?

There is an application on the phone, it has a function that reacts to a change in position, but it is apparently not always called. Here is a video of the application ==>

video
https://yadi.sk/i/tD_BHB2eHGvuZg

Here is the function -
function
public override void OnConfigurationChanged(Configuration newConfig)
        {
            base.OnConfigurationChanged(newConfig);

            if (newConfig.Orientation == Android.Content.Res.Orientation.Portrait)
            {
                Toast.MakeText(this, "go", ToastLength.Long).Show();
            }
            else if (newConfig.Orientation == Android.Content.Res.Orientation.Landscape)
            {
             Toast.MakeText(this, "go", ToastLength.Long).Show();
            }   
        }

Contents of the manifest
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
          android:versionCode="1" 
          android:versionName="1.0" 
          android:configChanges="keyboard|keyboardHidden|orientation|screenSize|navigation"
          package="com.companyname.app_6_">
  <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="28" />
  <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" >
  </application>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

Help please
PS I'm testing on SM-A70

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Stepanov, 2019-11-13
@AsceticSoft

try this: https://docs.microsoft.com/en-us/xamarin/essential...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question