2014-10-17 72 views
0

我的應用程序下載.zip,.js和.png,我想用另一個名爲Blocklauncher的應用程序打開它們。 Blocklauncher有一個特定的活動設置來打開這些文件。對於.js文件有一個意圖過濾器設置,因此應該打開它們。但.zip和.png文件並不那麼容易。繼承人什麼.png文件活動看起來像BlockLunchers清單Android - 用另一個特定的應用程序打開文件

<activity android:name="net.zhuoweizhang.mcpelauncher.api.ImportSkinActivity"> 
      <intent-filter> 
       <action android:name="net.zhuoweizhang.mcpelauncher.action.SET_SKIN" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
       <data android:mimeType="image/png" /> 
      </intent-filter> 
     </activity> 
     <activity-alias android:name="net.zhuoweizhang.mcpelauncher.ImportSkinActivity"  
android:exported="true" 
android:targetActivity="net.zhuoweizhang.mcpelauncher.api.ImportSkinActivity" /> 
     <activity android:name="net.zhuoweizhang.mcpelauncher.api.ImportTexturepackActivity"> 
      <intent-filter> 
       <action android:name="net.zhuoweizhang.mcpelauncher.action.SET_TEXTUREPACK" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
       <data android:mimeType="*/*" /> 
      </intent-filter> 
     </activity> 

任何人有任何想法?謝謝!

回答

1

那麼,如果BlockLauncher導入腳本與此:

Intent intentMTex = new Intent("net.zhuoweizhang.mcpelauncher.action.IMPORT_SCRIPT"); 
Uri texMPath = Uri.fromFile(new File(Environment.getExternalStorageDirectory().getPath() + "/Download/","Mech_Texture.zip")); 
intentMTex.setDataAndType(texMPath, "text/plain"); 

你有沒有試圖改變

intentMTex.setDataAndType(texMPath, "text/plain"); 

Intent("net.zhuoweizhang.mcpelauncher.action.IMPORT_SCRIPT); 

intentMTex.setDataAndType(texMPath, "image/png"); 

Intent("net.zhuoweizhang.mcpelauncher.action.SET_SKIN); 

? ():P

相關問題