简体   繁体   English

如何在Android中以编程方式阅读gmail

[英]how to read gmail programmatically in android

I know this questioned has been answered. 我知道这个问题已经得到回答。 I've found the exact same answer twice on stack overflow and once elsewhere. 我在堆栈溢出和其他地方都找到了完全相同的答案两次。 My problem is I can't get it to work. 我的问题是我无法正常工作。 I cut and paste it into Android Studio and I get the image pasted below. 我将其剪切并粘贴到Android Studio中,并在下面粘贴了图像。 It does not seem to recognize either Store or Session or the word mail. 它似乎无法识别“商店”或“会话”或“邮件”一词。 I'm not sure what I should be importing and Android Studio is not lending any help. 我不确定应该导入什么内容,Android Studio也没有提供任何帮助。 Any guidance would be greatly appreciated. 任何指导将不胜感激。

Thanks for the comments. 感谢您的评论。 I've edited my question with a new screen shot. 我用新的屏幕截图编辑了问题。 As you can see when I do alt enter on Session I get what looks like nonsense options dealing with spell checker and other things. 如您所见,当我在会话上输入alt时,我会得到一些看起来像废话选项的拼写检查器和其他内容。

Thanks again 再次感谢

Chris 克里斯

在此处输入图片说明

If you look carefully at the end of that prompt it will show you ALT+ENTER, that means you can press alt and hit enter at that point to have Android Studio assist you in picking 'which' Session class to import. 如果您仔细查看该提示的末尾,它将显示ALT + ENTER,这意味着您可以按alt并按Enter键,以使Android Studio协助您选择要导入的“会话”类。

The problem is that right now there are 'multiple classes that CAN be imported with the name Session' and the 'auto-importer' doesn't know which one you mean. 问题是,现在有和“自动进口”“ 可以与名会话导入多个类”不知道你在说哪一个。


My guess is that you need import javax.mail.Session; 我的猜测是您需要import javax.mail.Session; to import the Appropriate Session. 导入适当的会话。 (from This link that is talking about it ) (来自正在谈论它的此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM