We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Im try to get image from lib or camera but it's return error "Image provider can not be null". Any idea...
public class MainActivity extends AppCompatActivity { private ImageButton temp; private Uri image_uri; ImageButton inputImg; ImageView outputImg; Button submit; private ProgressBar prg; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); prg = findViewById(R.id.progressbar); inputImg = findViewById(R.id.dadImg); outputImg = findViewById(R.id.momImg); submit = findViewById(R.id.submit); inputImg.setOnClickListener(this::onImageClick); submit.setOnClickListener(this::postData); } public void postData(View v) { ... } public void onImageClick(View v) { Intent imagePicker = ImagePicker.Companion.with(MainActivity.this) .maxResultSize(1080, 1080, true).provider(ImageProvider.BOTH).createIntent(); launcher.launch(imagePicker); } ActivityResultLauncher<Intent> launcher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), (ActivityResult result) -> { if (result.getResultCode() == RESULT_OK) { Uri uri = result.getData().getData(); inputImg.setImageURI(uri); // Use the uri to load the image } else if (result.getResultCode() == ImagePicker.RESULT_ERROR) { ImagePicker.Companion.getError(result.getData()); } }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Im try to get image from lib or camera but it's return error "Image provider can not be null". Any idea...
The text was updated successfully, but these errors were encountered: