get Ppt File Intent - Android Intent

Android examples for Intent:Open File

Description

get Ppt File Intent

Demo Code


//package com.java2s;

import android.content.Intent;

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

public class Main {

    public static Intent getPptFileIntent(String param) {

        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        Uri uri = Uri.fromFile(new File(param));
        intent.setDataAndType(uri, "application/vnd.ms-powerpoint");
        return intent;
    }// w ww .ja  v a  2 s.  c om
}

Related Tutorials