2012-10-15 22 views
1

这里作者的名字是打开Adobe Reader时在Android的方式:打开Adobe阅读器在Android和指定注释

try { 
    Intent intent = new Intent(); 

    intent.setClassName("com.adobe.reader", "com.adobe.reader.AdobeReader"); 
    intent.setAction(Intent.ACTION_VIEW); 
    intent.setDataAndType(Uri.fromFile(doc), "application/pdf"); 

    startActivity(intent); 
} 
catch (ActivityNotFoundException activityNotFoundException) { 
    activityNotFoundException.printStackTrace(); 
} 

有没有办法打开它和注释注明作者名(我们可以通过adobe reader 10.4.0在pdf文档中使用annonations)?

在此先感谢!

扎卜

+0

确定只给你一些提示,我看到的Adobe阅读器存储在作者姓名参数:/data/data/com.adobe.reader/ shared_prefs/com.adobe.reader.preferences .xml也许我可以在我的应用程序启动Adobe Reader之前每次编辑这个文件。任何想法如何做到这一点? –

+0

有没有人知道Android上的Adobe Reader应用程序的SharedUserId,如果有的话? –

回答

0

我发现的唯一的解决方案是使用超级用户(上植根设备)。

这里是如何做到这一点:

Process suProcess = Runtime.getRuntime().exec("su"); 

    DataOutputStream os = new DataOutputStream(suProcess.getOutputStream()); 

    os.writeBytes("echo \"<?xml version='1.0' encoding='utf-8' standalone='yes' ?><map><string name='commentAuthorName'>toto</string></map>\" > /data/data/com.adobe.reader/shared_prefs/com.adobe.reader.preferences.xml \n"); 

    os.writeBytes("exit\n"); 
    os.flush(); 
    os.close(); 

    suProcess.waitFor();