码迷,mamicode.com
首页 > 其他好文 > 详细

Intent的调用

时间:2017-11-01 20:37:52      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:lte   set   class   extras   new   ice   extra   intent   star   

//Intent  intent=new Intent();
//intent.setClass(MainActivity.this, GPSService.class);
//以上二条可以合并成如下一条
Intent intent = new Intent(this,GPSService.class);
intent.putExtra("data1","youdata");
startActivit(intent );
//如果定义了Service,则调用startService(intent);  
获取数据
getIntent().getExtras().get("data1");


Intent的调用

标签:lte   set   class   extras   new   ice   extra   intent   star   

原文地址:http://www.cnblogs.com/gszw/p/7768110.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!