please help me.I don't know what the error is. I have clean it already nothing happens.I only just put an action bar to that activity..
there's no error when I closed the eclipse and
when i open it again, this happens.
The import android.support.v7.app
cannot be resolved
ActionBarActivity cannot be resolved to a type
The method onCreate(Bundle) of type MainViewActivity
must override or implement a supertype method..etc
MY Code
package com.example.slambook;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
public class MainViewActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_view);
ActionBar aa = getSupportActionBar();
aa.setDisplayShowTitleEnabled(false);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main_view, menu);
return true;
}
public void onClick(View v){
Intent i = new Intent(this,MainEditActivity.class);
startActivity(i);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_edit) {
Intent i = new Intent(this,MainEditActivity.class);
startActivity(i);
}
return super.onOptionsItemSelected(item);
}
}