2013-10-18 1 views
0

*.pls 파일 만 전달하도록 필터를 만들고 싶습니다. 개발자의 문서에 따르면 : http://developer.android.com/guide/topics/manifest/data-element.html 그것은 작동해야합니다 (제 생각에는)하지만 그렇지 않습니다. 예상 된 동작 (.pls 파일 만 전달) 대신 모든 파일 형식이 전달됩니다. 당신이 문서를 다시 읽어 경우android : pathPattern은 인 텐트 필터 동작에 영향을주지 않습니다.

<intent-filter> 

     <action android:name="android.intent.action.VIEW" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <category android:name="android.intent.category.BROWSABLE" /> 
     <data android:scheme="file" /> 
     <data android:mimeType="*/*" /> 
     <data android:pathPattern=".*\\.pls" /> 

</intent-filter> 

답변

0

당신은 android:path, android:pathPrefix에 관한이 줄을 알 수 있습니다, 그리고 android:pathPattern 이러한 속성

는 방식과 호스트가 도 지정하는 속성 경우에만 의미가 있습니다 필터.

android:host 속성이 누락되었습니다. 워드 프로세서가

+0

를 지정으로이 작동하지 않는 의도 필터에

<data android:host="*" /> 

를 추가 할 때 호스트 = (null)와 Google 드라이브에서 여는 경우와 같이, 파일 형식을 인식하지 못하게합니다. 누구든지 다른 대답을 가지고 있습니까? – NewEndian

+0

Google 드라이브에서 스키마가 파일이 아니라 콘텐츠 (추측 한 ContentProvider를 사용함) – Vincent