Android Question Can I execute a java code like this in B4A?

grafsoft

Well-Known Member
Licensed User
Longtime User
B4X:
Intent intent = new Intent();
intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_IMAGE);
 

DonManfred

Expert
Licensed User
Longtime User
Use contentchooser
 
Upvote 0

somed3v3loper

Well-Known Member
Licensed User
Longtime User
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
Top