I have tried invalidating the caches and restarting but it still shows up and will not compile and run as it used to before. I tried renaming the class file if i remember correctly and must have changed the name on something that made this how up. It also gives me the same error where findViewById, .oncreate, and setContentView. I migh have also renamed or tried to rename one of the packages because it was examplecom and it wouldnt allow me to upload it.
package com.threedeestone.mike.threedeestone;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.widget.EditText;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.text.DecimalFormat;
public class MainActivity extends ActionBarActivity {
To use the ActionBarActivity
or the AppCompatActivity
you have to add the appcompat library to your dependencies.
Add in your build.gradle
file the last version:
dependencies {
...
compile "com.android.support:appcompat-v7:23.0.0"
}
The version 23.0.0 requires to compile the project with API 23.
Otherwise you can use the 22.2.1.
Also pay attention.
The ActionBarActivity
is deprecated. Check the official javadoc.
You should use the AppCompatActivity
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With