内置PDF说明书(自己的APK中启动adobe.reader打开PDF)

<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卡。

                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值