5 Answers, 1 is accepted
0
Accepted
Hello Dimitar,
For described scenario, I could suggest using nativescript-file-picker plugin, which provides similar functionality. For further help, you could also review the plugin's repository here.
Let me know, whether this is applicable for you.
Regards,
nikolay.tsonev
Progress Telerik
For described scenario, I could suggest using nativescript-file-picker plugin, which provides similar functionality. For further help, you could also review the plugin's repository here.
Let me know, whether this is applicable for you.
Regards,
nikolay.tsonev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
0
Dimitar
Top achievements
Rank 1
answered on 31 Aug 2017, 01:33 PM
actually as I see I could simple do
let intent = new android.content.Intent() ;
intent.setType("image/*");
intent.setAction(android.content.Intent.ACTION_GET_CONTENT);
intent.addCategory(android.content.Intent.CATEGORY_OPENABLE);
app.android.foregroundActivity.startActivityForResult(intent,42) ;
0
Dimitar
Top achievements
Rank 1
answered on 31 Aug 2017, 01:58 PM
actually the code which I have psoted in previous post is open the native android picker , but I am not sure how this android override needed result should be added by nativescript
@Override
public void onActivityResult(int requestCode, int resultCode,
Intent resultData) {
if (requestCode == 42 && resultCode == Activity.RESULT_OK) {
Uri uri = null;
if (resultData != null) {
uri = resultData.getData();
Log.i(TAG, "Uri: " + uri.toString());
showImage(uri);
}
}
}
0
Dimitar
Top achievements
Rank 1
answered on 31 Aug 2017, 02:37 PM
I found way with code :
app.android.on(app.AndroidApplication.activityResultEvent, function (args: app.AndroidActivityResultEventData) {
console.log("Event: " + args.eventName + ", Activity: " + args.activity +
", requestCode: " + args.requestCode + ", resultCode: " + args.resultCode + ", Intent: " + args.intent);
0
Hello,
I glad to hear that you have found a way to handle the response from the Android file picker.
I tested the attached code and it seems to work as expected and to returns correct path to the selected file.
Let me know if I could assist you further.
Regards,
nikolay.tsonev
Progress Telerik
I glad to hear that you have found a way to handle the response from the Android file picker.
I tested the attached code and it seems to work as expected and to returns correct path to the selected file.
Let me know if I could assist you further.
Regards,
nikolay.tsonev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.