Android学习笔记
Chr1sMing
这个作者很懒,什么都没留下…
展开
-
Android中Activity跳转到具体的Fragment的方法
1、首先在需要跳转的Activity写此代码:Intent intent = new Intent(from, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra("flag", flag); from.startActivity(intent);2、在MainActivity中写此代码:@Override原创 2021-06-29 18:32:51 · 8025 阅读 · 9 评论 -
Android Studio中的button修改不了背景颜色
用android:background=""修改button的背景没有作用这时候可以将res/values/themes.xml下的<style name="Theme.HelloWorld" parent="Theme.MaterialComponents.DayNight.DarkActionBar">改为<style name="Theme.HelloWorld" parent="Theme.MaterialComponents.DayNight.DarkActionBar.B原创 2021-03-24 22:30:47 · 5003 阅读 · 3 评论