2016-02-19 19 views
11

一つはフラッターアプリからテントを使用して別のアクティビティを起動することができます。 https://github.com/flutter/flutter/blob/master/examples/widgets/launch_url.dartAndroid Intent FilterとしてFlutterアプリを登録したり、受信インテントを処理することは可能ですか?

import 'package:flutter/widgets.dart'; 
import 'package:flutter/services.dart'; 

void main() { 
    runApp(new GestureDetector(
    onTap:() { 
     Intent intent = new Intent() 
     ..action = 'android.intent.action.VIEW' 
     ..url = 'http://flutter.io/'; 
     activity.startActivity(intent); 
    }, 
    child: new Container(
     decoration: const BoxDecoration(
     backgroundColor: const Color(0xFF006600) 
    ), 
     child: new Center(
     child: new Text('Tap to launch a URL!') 
    ) 
    ) 
)); 
} 

しかし、一つはテントがアプリに渡されたときフラッター活動意向サービスで次の操作を行うことができますか?私の知る限り http://developer.android.com/training/sharing/receive.html

. . . 
void onCreate (Bundle savedInstanceState) { 
    ... 
    // Get intent, action and MIME type 
    Intent intent = getIntent(); 
. . . 

答えて

4

、この時点ではダートコードからの着信インテントを処理する方法はありません。特に、着信URLを処理する場合は、https://github.com/flutter/flutter/issues/357によって追跡されます。

Javaコードから受信したインテントを処理して、

に記載されているHostMessageシステムを使用してDartに結果を投稿することもできます
関連する問題