How to remove support for android v7 -app for support

I ran into some problem in android suppport v7 application. gives an error that some jars are missing. I want to make a simple hello world application with android v4 support or something like that, but how to remove android v7 support?

+6
source share
2 answers

It is a little troublesome to remove it. The easiest way is to simply create a new project by unchecking the "Create Activity" checkbox in the wizard and then adding a new class to src.

But if you really want to remove v7 material from an existing project, here is one way to delete it, the action bar and fragments:

  • Remove the android.libary.reference line from project.properties, ignoring the warning at the top.
  • Change the MainActivity type from ActionBarActivity to just Activity.
  • Remove import v7 and v4.Fragment.
  • Remove the integer "if (savedInstanceState)" statement from MainActivity.
  • Remove the PlaceholderFragment class from MainActivity.
  • Replace the contents of the activty_main.xml file with the contents of the fragment_main.mxl file or your own layout.
  • If you have not used your own layout, remove the tools: context attribute / value from Activity_main.xml.
  • Edit each of the three styles.xml files (under the * values) and change the parent style of the AppBaseTheme style to "android: Theme.Light" (or your choice).
  • Change the /main.mxl menu and remove the application: showAsAction attribute / value.
  • Organize the import and clean your project.

Just to be clear: this is not what you really want to do for a real application, but more than what you can do if you just create a demo or proof of concept.

Edit:

In the future, you can add an additional template that creates an Activity without appcompat_v7. You can get it on CommonsWare here . It's nice to write about it here .

+8
source

For your information, this happened because you upgraded your ADT to the latest version (22, I think).

0
source

All Articles