Android

Android Intent startActivityForResult Deprecate 이슈

Machine_웅 2021. 8. 24. 11:06
728x90
반응형
    // startActivityForResult deprecate 됨.
    ActivityResultLauncher<Intent> activityResultLauncher = registerForActivityResult(
            new ActivityResultContracts.StartActivityForResult(),
            new ActivityResultCallback<ActivityResult>() {
                @Override
                public void onActivityResult(ActivityResult result) {
                    if (result.getResultCode() == Activity.RESULT_OK) {
                        // There are no request codes
                        Intent data = result.getData();
                    }
                }
            });
  Intent intent = new Intent(this,Address_Webview.class);
                activityResultLauncher.launch(intent);
728x90
반응형