close Activity - Android Activity

Android examples for Activity:Activity Close

Description

close Activity

Demo Code


//package com.java2s;
import android.app.Activity;

import android.content.Intent;

public class Main {
    private static void closeActivity(Activity activity) {
        Intent intent = activity.getIntent();
        activity.setResult(Activity.RESULT_OK, intent);
        activity.finish();/*from  w w  w . ja  v  a2 s.c o  m*/
    }
}

Related Tutorials