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();//from ww  w .jav a2 s.  c o m
    }

}

Related Tutorials