include xml findbyId does not work in simulator



I've been looking for a hint on this one for a while and I've been running the debugger with a device and with the simulator and the later cannot find an element byID in the included XML, on the device it works fine. Simulator does find any element not in the include.



...
<include
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginBottom="20dp"
android:id="@+id/include_me"
layout="@layout/cur_include" />
...


and the cur_include.xml



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://ift.tt/nIICcg"
android:layout_height="wrap_content"
android:layout_width="160dp"
android:id="@+id/include_me"
android:orientation="vertical"
>
...
<ImageView
android:id="@+id/image1"
android:src="@drawable/picy"
...


I cannot access either on the simulator



View wrapper = findById(R.id.include_me)
ImageView vista = (ImageView)wrapper.findById(R.id.picy);


wrapper and vista are always null in the simulator tried what people recommend on similar threads but the simulator loves to return null.


My specs Eclipse Indigo 3.7.2, mac 10.9.5, API22, simulator with Google API18, since on the devices it works like a charm but not on the simulator it makes me afraid it may hit some user??? Or is this just a simulator bug????


No comments:

Post a Comment