自学android 坑2
来源:互联网 发布:圆形扇子淘宝网 编辑:程序博客网 时间:2024/06/16 06:38
从actity转向上级actity的时候
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); String message = intent.getStringExtra(MyActivity.EXTRA_MESSAGE); TextView textView = new TextView(this); textView.setTextSize(40); textView.setText(message); setContentView(textView); getSupportActionBar().setDisplayHomeAsUpEnabled(true);}
每次总是闪退 debug发现
getSupportActionBar()=null;
查阅资料后发现manifest中
<activity android:name=".DisplayMessageActivity" android:label="@string/title_activity_display_message" android:parentActivityName=".MyActivity" android:theme="@style/AppTheme.NoActionBar"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.example.qiyang.myapplication.MyActivity" /></activity>自动生成了AppTheme.NoActionBar
禁止了actionBar
0 0
- 自学android 坑2
- 自学Android 坑1
- Android自学笔记(2)
- Android 自学
- Android 自学
- android游戏开发自学笔记2 基础知识
- android游戏开发自学笔记3-2
- android自学总结2(数据传递)
- 自学2
- 自学Android系列 笔记2 Android 学习之Activity回传值
- 自学Android系列 笔记2 Android 学习之toast
- android自学总结
- 【转】android自学总结
- Android 暑期自学计划~~~
- Android OpenGL自学笔记
- android 数据库自学心得
- android 自学方法
- android自学总结1
- 在OPENSTACK建VM时候,设置采用SSH密码认证登录
- Fresco、SimpleDraweeView加载资源文件
- Ansible的循环
- 看别人看芒果娱乐节目
- ios本地通知
- 自学android 坑2
- Composer PHP的包管理器
- 大数加法+乘法
- Spring源码学习之一 ContextLoaderListener及XmlWebApplicationContext
- Hadoop参数设置中的关系疏理
- springmvc(十一)post乱码
- 高效使用Bitmaps, 神奇的Cache
- exit
- C# List源码分析(一)