1. AndroidManifest.xml의 기존 <intent-filter>외 아래를 추가합니다.
아래 예는 .txt만 연결하는거고 <data>를 여러개 등록하여 mimeType으로 조절하면 동영상만 가능할 것 같습니다.
<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" android:mimeType="text/*" android:pathPattern=".*txt" /> </intent-filter>
Intent intent = getIntent(); if (intent.getAction().equals(Intent.ACTION_VIEW)) { // 다른 앱이 실행할때 String filePath = intent.getData().getPath(); } else { // 직접 실행할때 }
로그인 유지
1. AndroidManifest.xml의 기존 <intent-filter>외 아래를 추가합니다.
아래 예는 .txt만 연결하는거고 <data>를 여러개 등록하여 mimeType으로 조절하면 동영상만 가능할 것 같습니다.
Intent intent = getIntent(); if (intent.getAction().equals(Intent.ACTION_VIEW)) { // 다른 앱이 실행할때 String filePath = intent.getData().getPath(); } else { // 직접 실행할때 }