Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import android.content.Context;
import android.content.Intent;

public class Main {
    private static Intent intent;

    public static void intentSysDefault(Context context, Class<?> classes, Map<String, String> paramMap) {
        organizeAndStart(context, classes, paramMap);
    }

    private static void organizeAndStart(Context context, Class<?> classes, Map<String, String> paramMap) {
        intent = new Intent(context, classes);

        if (null != paramMap) {
            Set<String> set = paramMap.keySet();
            for (Iterator<String> iterator = set.iterator(); iterator.hasNext();) {
                String key = iterator.next();
                intent.putExtra(key, paramMap.get(key));
            }
        }
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        context.startActivity(intent);
    }
}