2012-10-15 17 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();