解决方案 »
- android 怎么连接服务器,求各位大神搭救
- strings.xml 中的内容访问方法
- 自定义statusbar
- android txt英文与繁体中文中空格和回车消失
- 关于android调用web service的问题getResponse()方法的返回值
- 问一个有关ContentProvider的问题,有关自定义Cursor。PS:100%结贴,期待各位达人指点
- 请教一个关于读取远程服务器img文件,并显示在GridView中的思路
- 香奈儿互动展览厅-很炫的触摸设计
- method() throws Exception 为什么可以不用try{}catch(){}
- 新建的Android项目,怎么没有那个手机背景啊?
- Android新建项目 关联不上appcompad_v7
- 虚拟机可以运行!真机却不行
这里面没你说的TextView你的TextView在你的fragment_main.xml里面。
1,JAVA代码22行:
setContentView(R.layout.activity_main); 换成 setContentView(R.layout.fragment_main);
2,把fragment_main.xml中的TextView剪切到你的activity_main.xml中。
textView=(TextView)findViewById(R.id.textView); 你这个id是 fragment_main.xml中的TextView