修改AndroidManifest.template.xml,增加下面标粗的内容:
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" android:exported="true" android:excludeFromRecents="true" android:noHistory="true" android:windowDisablePreview="true" android:label="%activityLabel%" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:launchMode="singleTask"> <!-- Tell NativeActivity the name of our .so --> <meta-data android:name="android.app.lib_name" android:value="%libNameValue%" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
在Form.OnCreate中增加代码:
procedure TForm16.FormCreate(Sender: TObject); begin SharedActivity.getWindow.setFlags(TJWindowManager_LayoutParams.JavaClass.FLAG_SECURE, TJWindowManager_LayoutParams.JavaClass.FLAG_SECURE); end;
要手动引用两个单元:Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers
11.3,华为、小米测试通过。
标签:SECURE,LayoutParams,Delphi,JavaClass,截屏,android,true,app From: https://www.cnblogs.com/kinglandsoft/p/17428548.html