Highlighted

Android ANE onNewIntent listener

Participant ,
Mar 05, 2018

Copy link to clipboard

Copied

Hello,

does anybody know how to listen to onNewIntent?

I know how to use AndroidActivityWrapper with addActivityResultListener and addActivityStateChangeListner, but need also onNewIntent, which seems not to be  provided.

Thanks,

David

TOPICS
Development

Views

343

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Android ANE onNewIntent listener

Participant ,
Mar 05, 2018

Copy link to clipboard

Copied

Hello,

does anybody know how to listen to onNewIntent?

I know how to use AndroidActivityWrapper with addActivityResultListener and addActivityStateChangeListner, but need also onNewIntent, which seems not to be  provided.

Thanks,

David

TOPICS
Development

Views

344

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 05, 2018 0
Oldes LATEST
Participant ,
Mar 06, 2018

Copy link to clipboard

Copied

It looks I solved it somehow. I listen for InvokeEvent in AIR using:

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);

and than passing it to extension:

private function onInvoke(event:InvokeEvent):void {

    AndroidLeap.instance.onInvokeEvent();

}

where is the last intent stored in the activity:

static public class OnInvokeEvent implements FREFunction {

  @Override

  public FREObject call(FREContext context, FREObject[] args) {

    try{

      Intent intent = null;

      Activity act = context.getActivity();

      if(act != null) intent = act.getIntent();

      if(LeapExtension.VERBOSE > 0) Log.i(LeapExtension.TAG, "LEAP OnInvokeEvent act: "+ act+" intent: "+intent);

      if(intent!=null) {

        if(intent.getData()!=null) {

          if(LeapExtension.VERBOSE > 0) Log.i(LeapExtension.TAG, "LEAP OnInvokeEvent data: "+ intent.getData());

        }

        GCloud.Instance.onNewIntent(intent);

      }

    } catch (Exception e) {

      e.printStackTrace();

    }

    return null;

  }

}

I'm not sure if it is completely fine, but it looks it helps where I need it.

d.

PS: added as a feature request: Tracker

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2018 1