通过Intent即可,startActivity(intent)直接调出B的activaity;
解决方案 »
- gallery对齐实现
- Android ListView点击按钮产生的问题
- android 在一个activity中点击GridView中的一个Item一(包含图片和名字),
- android的autoCompleteTextVeiw控件问题
- APK 安装失败?
- Android 网络API 处理过后的网页源代码以网页显示出来!!!
- 关于Scrollview滑动如何跟Gridview一样快速
- Android请求C# WebService问题
- android sdk 运行时报错,求大神帮忙
- Android中设了4个按钮,却只有一个能用 求大神指点
- android有类型与j2me 里面运行jar的手机顽童模拟器吗?
- Android 1.6的系统能不能运行基于SDK 2.1开发的蓝牙软件?
StartActivity(intent)来启动。方法二:在B包的AndroidManifest.xml里面,定义intent-filter,
其中的action项,定义为action_view或者其他的。例如:直接从sdk里面抓的
<activity class=".TitleEditor" android:label="@string/title_edit_title"
android:theme="@android:style/Theme.Dialog">
<intent-filter android:label="@string/resolve_title">
<action android:name="com.android.notepad.action.EDIT_TITLE" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.ALTERNATIVE" />
<category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
<data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
</intent-filter>
</activity>在A包里面,通过intent.setAction(ACTION_VIEW),然后StartActivity(intent)来启动。
比较,前一种方法能启动具体的activity,并且不会有问题。
后一种是让系统查找,可以接受action的所有package,所以会列出所有能响应action的package,要谨慎使用。