This is my code from where I am accessing search_product_item.xml
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (RootUtil.isDeviceRooted())
finish();
if (getResources().getBoolean(R.bool.portrait)) {
SPAN_COUNT = 2;
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} else {
SPAN_COUNT = 4;
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
setContentView(R.layout.search_product_item);
This is search_product_item XML file
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_main" />
<include
android:id="@+id/footerLinkView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="@layout/layout_footer_link_view" />
<include
android:id="@+id/footerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/footerLinkView"
layout="@layout/layout_footer" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/footerView"
android:layout_below="@+id/toolbar"
android:layout_centerInParent="true" />
</RelativeLayout>
My Logcat
03-01 11:01:01.399: E/AndroidRuntime(20344): FATAL EXCEPTION: main
03-01 11:01:01.399: E/AndroidRuntime(20344): Process:
com.pg.dentistpartnerapp.mt, PID: 20344
03-01 11:01:01.399: E/AndroidRuntime(20344): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pg.dentistpartnerapp.mt/com.pg.dentistpartnerapp.mt.activities.SearchagainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f030048
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.ActivityThread.access$800(ActivityThread.java:144)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.os.Handler.dispatchMessage(Handler.java:102)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.os.Looper.loop(Looper.java:135)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.ActivityThread.main(ActivityThread.java:5221)
03-01 11:01:01.399: E/AndroidRuntime(20344): at java.lang.reflect.Method.invoke(Native Method)
03-01 11:01:01.399: E/AndroidRuntime(20344): at java.lang.reflect.Method.invoke(Method.java:372)
03-01 11:01:01.399: E/AndroidRuntime(20344): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
03-01 11:01:01.399: E/AndroidRuntime(20344): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
03-01 11:01:01.399: E/AndroidRuntime(20344): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030048
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.content.res.Resources.getValue(Resources.java:1233)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2598)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.content.res.Resources.getLayout(Resources.java:1049)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:249)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
03-01 11:01:01.399: E/AndroidRuntime(20344): at com.pg.dentistpartnerapp.mt.activities.SearchagainActivity.onCreate(SearchagainActivity.java:120)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.Activity.performCreate(Activity.java:5933)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
03-01 11:01:01.399: E/AndroidRuntime(20344): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
03-01 11:01:01.399: E/AndroidRuntime(20344): ... 10 more
I cleaned my project 100 times and restart the eclipse But problem didn't resolve. Please provide the solution.