G grafsoft Well-Known Member Licensed User Longtime User Apr 29, 2016 #1 B4X: Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_IMAGE);
B4X: Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_IMAGE);
somed3v3loper Well-Known Member Licensed User Longtime User Apr 29, 2016 #3 Or try using inline java something like this B4X: dim java as javaobject java.InitializeContext java.RunMethod("createmyIntent",null) B4X: #if java import android.content.Intent; import java.io.File; public void createmyIntent(){ Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_IMAGE); } #end if Upvote 0
Or try using inline java something like this B4X: dim java as javaobject java.InitializeContext java.RunMethod("createmyIntent",null) B4X: #if java import android.content.Intent; import java.io.File; public void createmyIntent(){ Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_IMAGE); } #end if
Erel B4X founder Staff member Licensed User Longtime User May 1, 2016 #4 The above code by itself will not work. This code will work: https://www.b4x.com/android/forum/t...ivityforresult-with-javaobject.40374/#content Upvote 0
The above code by itself will not work. This code will work: https://www.b4x.com/android/forum/t...ivityforresult-with-javaobject.40374/#content