Unable to click on link in gmail content through appium android testing

I want to do automatic email verification in android.But Unable to click on link in gmail content through appium android testing. How can i do this any alternate way?

WebElement element = driver.findElement(By
setTextInputValue(element, "[email protected]");

    WebElement searchList = driver.findElement(By
    List<WebElement> weekObjectSearchList = searchList.findElements(By
    WebElement list = driver.findElement(By
    List<WebElement> weekObjectList = list.findElements(By
    Set<String> contextNames = driver.getContextHandles();
    for (String contextName : contextNames) {
        System.out.println(contextNames); //prints out something like NATIVE_APP

It is not printing “WEBVIEW”

post screenshot of UIAutomatorviewer, also provide more details like code snippet.

It;s not printing webview because google app u r using in that webview debugger is not enabled so u r not allowed to work on webview elements…

as suggested in above comments just check if the element u want to click comes under native context using UIAutomatorviewer

I also suggest if u want to use gmail then open gmail.com in browser using appium and then perform this step as gmail is a third party app u cannot change anything in it’s build process so you can use appium automation on it as a hybrid app … But if you launch it as a webApp I hope you can interact with its elements …