zoukankan      html  css  js  c++  java
  • Why does eclipse automatically add appcompat v7 library support whenever I create a new project?

    Best ways to solve these:

    1. 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.

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

    3. 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>
    4. In res/values/styles.xml:

      <resources>
      
          <style name="AppBaseTheme" parent="android:Theme.Light">
      
          </style>
      
          <!-- Application theme. -->
          <style name="AppTheme" parent="AppBaseTheme">
      
          </style>
      
      </resources>
    5. In res/values-v11/styles.xml you have to change like these:

      <resources>
      
          <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
          </style>
      
      </resources>
    6. 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>
    7. 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>
    8. 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

    齊帥
  • 相关阅读:
    Zookeeper搭建集群及协同
    无限可能,Elasticsearch(一)
    如何打造一款m3u8视频爬虫
    垃圾如何进行自救
    必知必会的JavaJDK工具
    如何在局域网内开一家电影院
    谈谈网络游戏中的延迟解决方案
    简述一致性哈希算法
    Python网络爬虫实战(五)批量下载B站收藏夹视频
    Python网络爬虫实战(四)模拟登录
  • 原文地址:https://www.cnblogs.com/qishuai/p/4425138.html
Copyright © 2011-2022 走看看