R.java
doesn't contain id.collections
, it only contains main.xml
, like this :
public static final class menu {
public static final int main=0x7f0e0000;
}
Also, your app publishing and this issue are not related.
Where is your R.id.change_language
? If you wanna create customized actionbar with icon and title, you have to modify your main.xml
and add custom layout like below :
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/collection"
android:actionLayout="@layout/your_custom_layout"
android:showAsAction="ifRoom|withText"
android:title="ActionBar"/>
</menu>
your_custom_layout.xml :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/your_imageview"
android:background="@android:drawable/ic_menu_star" />
<TextView
android:id="@+id/change_language"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
then, you can findViewById
in onCreateOptionsMenu
function.
Hope this can help!