get Intent for */* file type - Android Intent

Android examples for Intent:Open File

Description

get Intent for */* file type

Demo Code


//package com.java2s;

import android.content.Intent;

import android.net.Uri;
import java.io.File;

public class Main {

    public static Intent getAllIntent(String param) {

        Intent intent = new Intent();
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setAction(android.content.Intent.ACTION_VIEW);
        Uri uri = Uri.fromFile(new File(param));
        intent.setDataAndType(uri, "*/*");
        return intent;
    }//from   w  ww. j  a  va 2  s  .com
}

Related Tutorials