AppCompatActivity和Activity的区别
AppCompatActivity,是继承与Activity的,当然集成了很多代以前才是Activity
首先是AppCompatActivity默认带标题
但Activity不带
而且AppCompatActivity和
requestWindowFeature(Window.FEATURE_NO_TITLE);
有冲突,用了没效果
继承Activity
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
继承AppCompatActivity
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
只是简单的区别,其他的 ,以后再补充,