<pre name="code" class="java"><a target=_blank href="http://blog.csdn.net/vrix/article/details/6851557">android 启动第三方程序的代码</a> http://blog.csdn.net/vrix/article/details/6851557
http://www.cnblogs.com/qingblog/archive/2012/08/10/2632220.html
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
package android.mymanual;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.content.ComponentName;
public class MymanualActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent mIntent = new Intent();
//mIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);
ComponentName comp = new ComponentName("com.adobe.reader","com.adobe.reader.AdobeReader");
mIntent.setComponent(comp);
mIntent.setAction("android.intent.action.VIEW");
mIntent.setDataAndType(Uri.parse(getString(R.string.data)),getString(R.string.type));//关联PDF文档或其它MimeType
startActivity(mIntent);
}
}
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
<span style="font-family:Arial, Helvetica, sans-serif;">AndroidManifest.xml:</span>
<span style="font-family:Arial, Helvetica, sans-serif;"><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.</span><span style="font-family: Arial, Helvetica, sans-serif;">mymanual</span><span style="font-family: Arial, Helvetica, sans-serif;">"</span><span style="font-family:Arial, Helvetica, sans-serif;">
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".M</span><span style="font-family: Arial, Helvetica, sans-serif;">ymanual</span><span style="font-family: Arial, Helvetica, sans-serif;">Activity"</span><span style="font-family:Arial, Helvetica, sans-serif;">
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
</span>
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
<span style="font-family: Arial, Helvetica, sans-serif;">strings.xml:</span>
<pre name="code" class="java"><?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Manual</string>
<string name="data">file:///sdcard/primux/Manual.pdf</string>
<string name="type">application/pdf</string>
</resources>
</pre><pre name="code" class="java">需预先内置PDF到SD卡。