中添加地址布局 - 小activity.xml你好我与本教程https://stackoverflow.com/q/7665194/840861使res/layout-small/my_layout.xml和我想在主要活动中添加此xml文件,但不能解决它像这样教程https://android-developers.googleblog.com/2011/07/new-tools-for-managing-screen-sizes.html如何在类
我想这样的代码:
public class MyActivity extends Activity {
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate();
Configuration config = getResources().getConfiguration();
if (config.smallestScreenWidthDp >= 600) {
setContentView(R.layout.main_activity_tablet);
} else {
setContentView(R.layout.main_activity);
}
}
}
我的代码是:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
setContentView(R.layout.activity_main);
}
,但不能这个地址的xml:
setContentView(R.layout-small.activity_main);
和我创造佳绩的文件夹布局小和过去的xml文件activity_main但不能添加地址
对不起我不是良好的英语语言