临Android的2:什么是getTextView()和registerMenu()? [英] Pro Android 2: What are getTextView() and registerMenu()?
问题描述
清单中的<一个3-33 href="http://stackoverflow.com/questions/4390290/fastest-path-to-anroid-development-for-a-non-java-programmer/4390314#4390314">acclaimed临Android的2本书(来源$ C $ C可以发现这里)引用两个该功能的定义我一直没能找到无论是在Android的SDK或所有在这本书本身清单:
- getTextView()
- registerMenu()
这些是什么功能,在那里他们可以找到?
公共无效的onCreate(包savedInstanceState){
super.onCreate(savedInstanceState);
TextView的电视=新的TextView(本);
tv.setText(Helloe,Android的打个招呼。);
的setContentView(电视);
registerForContextMenu(电视);
}
将修复这些方法的问题不存在。
和无书我看过Android是没有它的错字,缺位等。
PS。菜单将是一个菜单,显示了当你preSS向下的TextView。
Listing 3-33 in the acclaimed Pro Android 2 book (source code can be found here) references two functions of which definitions I haven't been able to find in either the Android SDK or all listings in the book itself:
- getTextView()
- registerMenu()
What are these functions and where can they be found?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Helloe, Android. Say Hello");
setContentView(tv);
registerForContextMenu(tv);
}
will fix the problem of those methods not existing.
And no book I have read on Android is without its typos, missing bits etc.
PS. the menu will be a menu that shows up when you press down on the 'TextView'.
这篇关于临Android的2:什么是getTextView()和registerMenu()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!