我正在使用来自 url_launcher 页面的文档:https ://pub.dev/packages/url_launcher#android
AndroidManifest.xml:
<queries>
<!-- other intents ... -->
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>
代码:
final Uri emailLaunchUri = Uri(
scheme: 'mailto',
path: 'smith@example.com',
);
launch(emailLaunchUri.toString());
并得到下一个错误:
E/flutter (11956): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(ACTIVITY_NOT_FOUND, No Activity found to handle intent { mailto:smith@example.com }, null, null)
E/flutter (11956): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (11956): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (11956): <asynchronous suspension>
E/flutter (11956): #2 launch (package:url_launcher/url_launcher.dart:99:23)
E/flutter (11956): <asynchronous suspension>
E/flutter (11956): #3 MoreTab.build.<anonymous closure> (package:app/screens/fixtures_screen/more_tab/more_tab.dart:34:13)
E/flutter (11956): <asynchronous suspension>