8
I imported the project from an eclipse app for Android Studio. The import went smoothly and Gradle was created. However, I realize that the visual components like Edittext, Progressbar, Appbar, Button are with a lagged look, the version 3.0 android. I upgraded my minSdk to 15 and targetSdk to 23 and upgraded Radle, but the visual components are still in the old Apis.
I also realize that every time I create a new Activity, I have the following pattern:
import android.app.Activity;
import android.os.Bundle;
public class TesteActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_teste);
}
}
As activitys inherit only from Activity, and not of Appcompatactivity, as seen below in any project created in Android Studio:
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
By altering the inheritance of TesteActivity
of Activity
for AppCompatActivity
, Android does not recognize the class. Remembering that this problem occurs only within the eclipse imported project.
Is there any way to import this old project, to work with the most modern components/features of Android Studio?
Even putting this in the dependencies, it continues with the message of Cannot solves Symbol 'Appcompatactivity' when inheriting the class. When running Gradle to update, the error appears: * What Went Wrong: A problem occurred evaluating root project 'spinsuite-brerp'. > Could not find method Compile() for Arguments [com.android.support:appcompat-v7:23.3.0] on org.gradle.api.internal.artifacts.dsl.dependencies.Defaultdependencyhandler_decorated@3ad836c1.
– antunesleo_
See which version you use, it’s usually the same as buildTools. 'com.android.support:appcompat-v7:(Your version)'
– kleiser sarifo