Reputation: 52770
How do I replace Android code that uses the onActivityResult
functionality of native Android programming within a Codename One native class.
I can invoke a standard Activity
in the code using:
AndroidNativeUtil.getActivity().startActivity(myIntent);
And importing:
import com.codename1.impl.android.AndroidNativeUtil;
But how do I get the result?
Upvotes: 2
Views: 185
Reputation: 52770
You can use
AndroidNativeUtil.startActivityForResult(intent, new IntentResultListener() {
public void onActivityResult (int requestCode, int resultCode, Intent data) {
// your android native code here...
}
});
Notice that your imports should now include:
import com.codename1.impl.android.AndroidNativeUtil;
import com.codename1.impl.android.IntentResultListener;
Upvotes: 1