Usage of current activity in android app

Hi,

I am trying to use the “current activity” in node.js code. but its not giving the current activity name, when i am printing it.

I dont find syntax in API reference docs.

I am trying to use this as below:

driver.execute(“mobile: current_activity”)

Thanks

If you are using wd.js as your driver, try this:

driver.getCurrentActivity(function(err, activity) {
  console.log(activity);
});