---
title: "IntentFilter使用"
author: "ableouou"
date: "2010-12-24T10:16:25Z"
tags: []
categories: ["移动开发"]
slug: "intentfilter"
draft: false
lastmod: "2010-12-24T10:16:25Z"
id: 850871
url: "https://ableouou.iteye.com/blog/850871"
---

一直对于处于不同的application的activity的调用，心存疑虑。
昨天，使用intent的隐式调用进行了实现。
首先，建立一个android 工程，就比如HelloWorld程序，只需要在该activity下加入属性：
<intent-filter>
<action android:name="com.able.test.aaa"></action>
<category android:name="android.intent.category.DEFAULT"></category>
</intent-filter>
，再建立一个android工程，我们就称之为Test，只需要在里面使用：
 Intent intentA = new Intent("com.able.test.aaa");
                intentA.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                startActivity(intentA);
就可以成功调用HelloWorld程序的那个加入了intent-filter的activity。