Finish a Activity by setting result to Activity.RESULT_OK - Android android.app

Android examples for android.app:Activity

Description

Finish a Activity by setting result to Activity.RESULT_OK

Demo Code

import android.app.Activity;
import android.content.Intent;

public class Main{

    public static void Finish(Activity activity, Intent data) {
        activity.setResult(Activity.RESULT_OK, data);
        activity.finish();//  w  w  w . j av a  2 s . co  m
    }

}

Related Tutorials