Android intent
2009-09-03 15:01
393 查看
1. Explicit intent:
-- In the same application
Intent intent = new Intent(this, TestActivity.class);
startActivity(intent);
//startService(intent);
-- In differenct application
Intent intent = new Intent();
intent.setClassName("com.china.testapp", "com.china.testapp.TestActivity");
startActivity(intent);
//startService(intent);
2. Implicit intent:
Intent intent = new Intent("com.china.testapp.MYACTION");
startActivity(intent);
//startService(intent);
--OR
Intent intent = new Intent();
intent.setAction("com.china.testapp.MYACTION");
startActivity(intent);
//startService(intent);
--API reference:
-- In the same application
Intent intent = new Intent(this, TestActivity.class);
startActivity(intent);
//startService(intent);
-- In differenct application
Intent intent = new Intent();
intent.setClassName("com.china.testapp", "com.china.testapp.TestActivity");
startActivity(intent);
//startService(intent);
2. Implicit intent:
Intent intent = new Intent("com.china.testapp.MYACTION");
startActivity(intent);
//startService(intent);
--OR
Intent intent = new Intent();
intent.setAction("com.china.testapp.MYACTION");
startActivity(intent);
//startService(intent);
--API reference:
public Intent (String action)
Create an intent with a given action. All other fields (data, type, class) are null. Note that the action must be in a namespace because Intents are used globally in the system -- for example the system VIEW action is android.intent.action.VIEW; an application's custom action would be something like com.google.app.myapp.CUSTOM_ACTION.相关文章推荐
- android基础学习6——intent实现数据传递
- Android学习日记——INTENT
- Android开发之Intent.Action
- android Intent Flags及Task相关属性
- android用于打开各种文件的intent
- android intent 传值,如何 接受int 类型,一解决
- Android android.intent.category解析
- Android------Intent.createChooser
- Android 读书笔记---Intent 和 IntentFilter
- Android 用Intent调用系统中经常被用到的组件
- android笔记10-intent
- Android Intent详解
- AndroidManifest.xml 之intent-filter 中 Action
- Android Intent应用
- Android Intent.FLAG_NEW_TASK详解,包括其他的标记的一些解释
- 解决Android 5.0中出现的警告:Service Intent must be explicit
- AIR Native Extension:在Android的Flex应用中调用Android Intent实现分享功能
- Androidmainfest主配置文件以及intent的跳转
- Android之Service与IntentService的比较
- Android中的显隐式Intent