如何实现多个应用程序间的调用 想做一个类似书架的东西 ,里面放的不是书 是 一系列的 应用程序 apk,但是 不知到 如何 在这个 外壳 调用 其他应用程序 ,请大牛指导 ,有围观的 也欢迎 ! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 貌似入门级的ANDROID教材都有介绍啊。 http://topic.csdn.net/u/20110419/18/0467043D-6A63-4B77-BF69-7C1F362715A1.html这个帖子说的不错 ,有兴趣的可以看下但是 还是期待 更加棒的 idea. 现在 :注意 我要追加 问题 了 @!! 我需要使用到另一个apk中的 一个类,请问如何 调用到 资源! 具体思路是这样的:可以做一个ListView,每个ListView的item都包含应用程序的icon和title然后点击这个item,可以打开应用程序public Intent getIntent() { if (intent != null) return intent; intent = null; try { intent = pm.getLaunchIntentForPackage(pkginfo.packageName); if (intent != null) { intent = intent.cloneFilter(); intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); return intent; } if (pkginfo.activities.length == 1) { intent = new Intent(Intent.ACTION_MAIN); intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); intent.setClassName(pkginfo.packageName, pkginfo.activities[0].name); return intent; } intent = IntentList.getIntent(pkginfo.packageName, pm); if (intent != null) { intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); return intent; } } catch (NameNotFoundException e) { return null; } return null; }通过上面的代码判断Intent具体源代码详见:http://www.eoeandroid.com/forum.php?mod=viewthread&tid=35610 补充一点,因为下载是需要账号的,如果你不想注册账号,可以直接找我要,邮箱是[email protected] 在程序里面放程序? 直接在你的书架里面制成APK应用程序的图标。然后用intnet调用另起一个ACTIVITY就OK了 不是很难的哦。 我想你搞错了,假如一个APK有三个Activity,你不可能直接跳到第三个Activity,除非第二个Activity没有传任何参数给他,否则一定会出现异常,只能从第一个Activity进入APK程序 你可以获取指定的Activity的资源:代码如下:1.通过PackageManager获取指定APK的PackageInfoActivityInfo[] array=packageInfo.activities;for(int i=array.size-1;i>=0;i--){ActivityInfo info=array[i];info.configChanges;info.flags//详见http://developer.android.com/reference/android/content/pm/ActivityInfo.html 如果不是Activity,service,broadcastreciver,你可以将该类编译的时候编译成库或者jar,这样就可以通过import,然后使用该类了如果是,Activity,service,broadcastreciver等,直接发intent。 如何实现移动办公? 跪求:数据库拷贝到哪里? 必须在activity中操作文件夹吗? android mms android上进行图像处理(如锐化,调整对比度)最好使用哪个类 android2.3 USB网卡,USB以太网 谁能给我讲一下android里的atts 谢谢了,这是自定义是属性还是系统属性? android谷歌地图问题 android anr 如何处理 求意见 各位,app能放在u盘上后,再安装到手机里吗 制作android流媒体播放器如何添加媒体格式 android入门
这个帖子说的不错 ,有兴趣的可以看下但是 还是期待 更加棒的 idea.
@!!
我需要使用到另一个apk中的 一个类,请问如何 调用到 资源!
然后点击这个item,可以打开应用程序public Intent getIntent() {
if (intent != null) return intent;
intent = null;
try {
intent = pm.getLaunchIntentForPackage(pkginfo.packageName);
if (intent != null) {
intent = intent.cloneFilter();
intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
return intent;
}
if (pkginfo.activities.length == 1) {
intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
intent.setClassName(pkginfo.packageName, pkginfo.activities[0].name);
return intent;
}
intent = IntentList.getIntent(pkginfo.packageName, pm);
if (intent != null) {
intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
return intent;
}
} catch (NameNotFoundException e) {
return null;
}
return null;
}通过上面的代码判断Intent
具体源代码详见:http://www.eoeandroid.com/forum.php?mod=viewthread&tid=35610
代码如下:
1.通过PackageManager获取指定APK的PackageInfo
ActivityInfo[] array=packageInfo.activities;
for(int i=array.size-1;i>=0;i--){
ActivityInfo info=array[i];
info.configChanges;
info.flags
//详见http://developer.android.com/reference/android/content/pm/ActivityInfo.html
如果不是Activity,service,broadcastreciver,你可以将该类编译的时候编译成库或者jar,这样就可以通过import,然后使用该类了如果是,Activity,service,broadcastreciver等,直接发intent。