Android examples for Intent:Open File
get Rar File Intent
//package com.java2s; import android.content.Intent; import android.net.Uri; import java.io.File; public class Main { public static Intent getRarFileIntent(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/rar"); return intent; }/*from w w w . ja v a2s . com*/ }