Johan Schoeman Expert Licensed User Longtime User Aug 14, 2022 #1 Please help a "dummy" with retrieving a Bitmap from an intent. The library defines the key as: B4X: Copy public static final String KEY_PHOTO = "photo"; And this is how it gets the Bitmap from the intent to add it to an ImageView: B4X: Copy if (getIntent().hasExtra(KEY_PHOTO)) { ((ImageView) findViewById(R.id.view_photo)).setImageBitmap((Bitmap) getIntent().getParcelableExtra(KEY_PHOTO)); So, what would B4A equivalent be to extract the Bitmap from the returned intent (I can already extract all the Strings in the returned intent). Should it be as below? B4X: Copy Dim jo As JavaObject = i Dim mbm As Bitmap = jo.RunMethod("getParcelableExtra", Array As Object("photo")) I am just very in(tent)experienced.... Last edited: Aug 14, 2022
Please help a "dummy" with retrieving a Bitmap from an intent. The library defines the key as: B4X: Copy public static final String KEY_PHOTO = "photo"; And this is how it gets the Bitmap from the intent to add it to an ImageView: B4X: Copy if (getIntent().hasExtra(KEY_PHOTO)) { ((ImageView) findViewById(R.id.view_photo)).setImageBitmap((Bitmap) getIntent().getParcelableExtra(KEY_PHOTO)); So, what would B4A equivalent be to extract the Bitmap from the returned intent (I can already extract all the Strings in the returned intent). Should it be as below? B4X: Copy Dim jo As JavaObject = i Dim mbm As Bitmap = jo.RunMethod("getParcelableExtra", Array As Object("photo")) I am just very in(tent)experienced....
Erel B4X founder Staff member Licensed User Longtime User Aug 14, 2022 #2 Array = Array As Object What happens with the code you posted? Upvote 0
Johan Schoeman Expert Licensed User Longtime User Aug 14, 2022 #3 Erel said: Array = Array As Object What happens with the code you posted? Click to expand... Waiting someone that I a trying to assist to test it. Erel, not sure what you mean with Array = Array As Object The b4a code above does have Array as Object("photo") Upvote 0
Erel said: Array = Array As Object What happens with the code you posted? Click to expand... Waiting someone that I a trying to assist to test it. Erel, not sure what you mean with Array = Array As Object The b4a code above does have Array as Object("photo")
Erel B4X founder Staff member Licensed User Longtime User Aug 14, 2022 #4 I prefer to write: Code: Copy Dim mbm As Bitmap = jo.RunMethod("getParcelableExtra", Array("photo")) The result is the same. Upvote 0
I prefer to write: Code: Copy Dim mbm As Bitmap = jo.RunMethod("getParcelableExtra", Array("photo")) The result is the same.