For example, if I want to add this method:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
//some code I add later...
}
is there a way to add it without typing it all? I know that when I want the onClick method, I implement it in the class, then it shows an error, I hover my mouse over and click add unimplemeted methods, and it's there.
在Eclipse中,右键单击该类,从上下文菜单中选择Source> Override / Implement Methods,然后选中要添加到该类的方法。
I know another simple way to quickly add such methods in eclipse. I think you know about intellisense - write some characters then press Ctrl + Space
. The available options will be shown in a dropdown list if there are multiple option. For single option the word will be just written.
Ok now for your case onActivityResult
. Type few characters like onActivity
then trigger intellisense. You'll see a list of few options. From there select onActivityResult
by pressing up and down key and press enter. You'll see the whole method is written down.
I do that all the time. No mouse click, just type few characters.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.