Usage of current activity in android app


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”)


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

driver.getCurrentActivity(function(err, activity) {