有两个页面,分别是不同的布局有各自的xml文件,在当前页我可以通过
View v = findViewById(R.id.main);
v.getBackground().setAlpha(0);来设置背景透明度,但我想在当前页面
用同样方法设置另一个页面透明度就会报空指针错误,请各位大侠帮我解决下
谢谢了
View v = findViewById(R.id.main);
v.getBackground().setAlpha(0);来设置背景透明度,但我想在当前页面
用同样方法设置另一个页面透明度就会报空指针错误,请各位大侠帮我解决下
谢谢了
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.custom_dialog,null);
TextView text = (TextView) layout.findViewById(R.id.text);