5

Today, i have been updated android support v7 appcompat to version 23. After update, eclipse show error Call requires API level 11 (current min is 8): android.app.Activity#onCreateView at header of file. This is my java code

package xxxxxx.xxxxxxx.xxxx.xx.activity;

import xxxxxx.xxxxxxx.xxxx.xx.R;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.LinearLayout;
import android.widget.TextView;

public class SingActivity extends AppCompatActivity {
    private LinearLayout layInfo;
    private TextView lblSongName;
    private TextView lblStatus;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sing);

        layInfo = (LinearLayout) findViewById(R.id.lay_info);
        lblSongName = (TextView) findViewById(R.id.lbl_song_name);
        lblStatus = (TextView) findViewById(R.id.lbl_status);
    }

    @Override
    public void onBackPressed() {
        finish();
    }
}
Du Huynh
  • 151
  • 1
  • 13
  • What if you extend from `ActionBarActivity` instead of `AppCompatActivity`? – Phantômaxx Sep 01 '15 at 06:48
  • `ActionBarActivity` has been deprecated – Du Huynh Sep 01 '15 at 06:52
  • 1
    Check if you are using http://developer.android.com/reference/android/app/Activity.html#onCreateView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) – Gabriele Mariotti Sep 01 '15 at 07:00
  • @GabrieleMariotti, i don't use `onCreateView` any time, above is all of code of activity – Du Huynh Sep 01 '15 at 07:03
  • Deprecation of ActionBarActivity is just a `hint` for you to use new AppCompatActivity directly. See what @ChrisBanes himself says about: http://stackoverflow.com/a/29799144/2649012 – Phantômaxx Sep 01 '15 at 07:05
  • I do have the same problem. I think the only chance is currently to upgrade to API 11 - at least I have not found another solution – Carsten Sep 01 '15 at 07:09
  • 1
    It is a very strange issue. You minSdk supports this level. Are you using api23 to compile? – Gabriele Mariotti Sep 01 '15 at 07:22
  • @GabrieleMariotti, You are right, it is very strange! `onCreateView` function added from api version 1, but now show me error about min support api 8 – Du Huynh Sep 01 '15 at 07:32
  • Yes, that is an odd one, it started to happen to me as well somewhat recently every now and then when changing code. I believe that's not an Eclipse error, but a Lint generated one. And it possibly started to occur when updating to Android SDK Build Tools 23.0.0. It appears to go away when cleaning the project . – Dan Dar3 Sep 09 '15 at 13:01
  • @DuHuynh Did you ever manage to solve this problem? I'm having the exact same issue. – Matthew Tory Sep 18 '15 at 21:57
  • @grimrader22, that maybe problem of eclipse. My Pc in my company show error but my Pc in my home not show. So i don't know what is exactly of problem... – Du Huynh Sep 21 '15 at 03:09
  • everytime i open eclipse, this error show up beside the package. So i just clean the project and it disappear. – Tuss Sep 26 '15 at 04:36
  • 1
    This is caused by a bug in the Android SDK - anyone who's affected should [star it here](https://code.google.com/p/android/issues/detail?id=188677). – nkorth Oct 14 '15 at 17:44
  • Possible duplicate of [Call requires API level 11(current min is 8) android.app.Activity#onCreateView](http://stackoverflow.com/questions/32181705/call-requires-api-level-11current-min-is-8-android-app-activityoncreateview) – Murmel Oct 18 '15 at 21:31

0 Answers0