您的位置:首页 > 移动开发

Why does eclipse automatically add appcompat v7 library support whenever I create a new project?

2015-04-14 15:55 881 查看
Best ways to solve these:

Firstly in project,
Right click->properties->Android
.There you can see the
red marked appcompat
placed in
Reference
. Click that and Remove it.Then Tick the right target name in
Project Build Target
.

Delete fragment_main.xml and Appcompat file created in your Eclipse.

Edit and change your activity_main.xml like these:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout 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">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />

</RelativeLayout>


In res/values/styles.xml:

<resources>

<style name="AppBaseTheme" parent="android:Theme.Light">

</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">

</style>

</resources>


In res/values-v11/styles.xml you have to change like these:

<resources>

<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
</style>

</resources>


In res/values-v14/styles.xml you have to change like these:

<resources>

<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
</style>

<style name="AppTheme" parent="AppBaseTheme">
</style>

</resources>


Change your menu/main.xml like these:

<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>

</menu>


Finally change your MainActivity.java like these:

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

}

}


LikeWise you have to do it for creating a new project
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: