android - R cannot be resolved and no error in xml file -


this first time i'm using eclipse. without making changes in of xml files when run package, i'm getting errors as: r cannot resolved variable. following source java file:

import android.app.activity; import android.os.bundle; import android.view.menu;  public class startingpoint extends activity {      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_starting_point);     }      @override     public boolean oncreateoptionsmenu(menu menu) {         // inflate menu; adds items action bar if present.         getmenuinflater().inflate(r.menu.starting_point, menu);         return true;             } } 

it gives error on both lines r.layout , r.menu used. following layout's xml file:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:paddingbottom="@dimen/activity_vertical_margin"     android:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     tools:context=".startingpoint" >      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/hello_world" />  </relativelayout> 

and menu xml file:

<item     android:id="@+id/action_settings"     android:orderincategory="100"     android:showasaction="never"     android:title="@string/action_settings"/> 

i've tried cleaning , restarting nothing works , there no error in xml files. kindly let me know how fix error. thank you.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -