Eclipse behaving differently while creating new project/activity

血红的双手。 提交于 2019-12-05 03:26:35

问题


Whenever I create new project it always creating appcompat_v7 project with my new project. And when I create new android activity it always extend ActionBarActivity and also create fragment_main.xml. I tried to update adt and s\w also still no luck

and this code also generated in main activity

 public static class PlaceholderFragment extends Fragment {

    public PlaceholderFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_main, container,
                false);
        return rootView;
    }
} 

回答1:


I had the same problem. I have figured out 3 ways hope this helps

  1. (this may or may not work) Check your android virtual device manager. I would think you have a device that has CPU/ABI selected for "armeabi-v7a". Delete that device and try creating a new project. You would notice that project appcompat_v7 is no longer being created.
  2. (Works) Another way to avoid this would to create new project through android project through existing codes. Hopeful you have a project you created from before to copy over.
  3. (Works) Create a blank android project without activity and create the activity later.


来源:https://stackoverflow.com/questions/22250633/eclipse-behaving-differently-while-creating-new-project-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!