Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * This software and related documentation ("CK-Telecom Software") are
 * protected under relevant copyright laws. The information contained herein
 * is confidential and proprietary to CK-Telecom. and/or its licensors.
 * Without the prior written permission of CK-Telecom. and/or its licensors,
 * any reproduction, modification, use or disclosure of CK-Telecom Software,
 * and information contained herein, in whole or in part, shall be strictly              
 * prohibited.
 * CK-Telecom (C) 2012. All rights reserved.
 */

import java.io.File;

import android.app.Activity;

import android.content.Intent;

import android.net.Uri;

public class Main {
    public static void disImage(Activity act, File file) {
        Intent itt = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
        itt.setData(Uri.fromFile(file));
        act.sendBroadcast(itt);

        Intent it = new Intent(Intent.ACTION_VIEW);
        it.setDataAndType(Uri.parse(file.getPath()), "image/*");
        act.startActivity(it);
    }
}