2016-02-19 45 views
11

人们可以使用来自扑应用程序的意图启动其他活动: https://github.com/flutter/flutter/blob/master/examples/widgets/launch_url.dart是否可以将Flutter应用注册为Android Intent Filter并处理传入意图?

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(); 
. . . 

回答

相关问题