startActivity(intent);
} else if (id == 7) {
Toast.makeText(Main.this, “ID=7:暂未自定义标题栏,无法预览。”,
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(Main.this, “ID=” + id + “非法,请参考提供文字。”,
Toast.LENGTH_SHORT).show();
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Show Activity,接收Main传来的数,用来显示对应的预览效果:
package com.zms.windowfeature;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class Show extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
Intent intent = getIntent();
String idStr = intent.getStringExtra(“idStr”);
int id = Integer.parseInt(idStr);
requestWindowFeature(id);
setContentView(R.layout.show);
}
public void Back(View v) {
finish();
}
}
文字描述都在主布局文件里面了,也贴上来吧:
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:tools=“http://schemas.android.com/tools”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:orientation=“vertical”
tools:context=“com.zms.windowfeature.Main” >
<EditText
android:id=“@+id/etNowId”
android:layout_width=“200dp”
android:layout_height=“wrap_content”
android:hint=“请输入效果ID”
android:inputType=“number” >
<TextView
android:id=“@+id/tvNowId”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“@string/hello_world” />
<Button
android:id=“@+id/btnShow”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“Show” />
<TextView
android:layout_width=“fill_parent”
android:layout_height=“wrap_content”
android:text="
FEATURE_OPTIONS_PANEL = 0; 功能不明,参见后面的说明(默认使能)
FEATURE_NO_TITLE = 1; 无标题栏
FEATURE_PROGRESS = 2; 在标题栏上显示加载进度,例如webview加载网页时(条状进度条)
FEATURE_LEFT_ICON = 3; 在标题栏左侧显示一个图标
FEATURE_RIGHT_ICON = 4; 在标题栏右侧显示一个图标
FEATURE_INDETERMINATE_PROGRESS = 5; 不确定的进度(圆圈状等待图标)
FEATURE_CONTEXT_MENU = 6; 上下文菜单,相当于PC上的右键菜单(默认使能)
FEATURE_CUSTOM_TITLE = 7; 自定义标题栏,该属性不能与其他标题栏属性合用
FEATURE_OPENGL = 8; 如果开启OpenGL,那么2D将由OpenGL处理(OpenGL中2D是3D的子集)
PROGRESS_VISIBILITY_ON = -1; 进度条可见
PROGRESS_VISIBILITY_OFF = -2; 进度条不可见
PROGRESS_INDETERMINATE_ON = -3; 开启不确定模式
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)
![](https://img-blog.csdnimg.cn/img_convert/e5730288f86c807618c877c9f1da02b4.jpeg)
尾声
在我的博客上很多朋友都在给我留言,需要一些系统的面试高频题目。之前说过我的复习范围无非是个人技术博客还有整理的笔记,考虑到笔记是手写版不利于保存,所以打算重新整理并放到网上,时间原因这里先列出面试问题,题解详见:
展示学习笔记
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
见:
[外链图片转存中…(img-ZW6B2lkW-1712346383485)]
展示学习笔记
[外链图片转存中…(img-14l4Pm9N-1712346383486)]
[外链图片转存中…(img-GfLzzLGG-1712346383486)]
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!