xml – Android: How to fill RelativeLayout to full width of screen?-ThrowExceptions

Exception or error: I am creating an Android app which has a main RelativeLayout and some LinearLayout within it. Now i have this problem. When dragging items to the editor, e.g. a LinearLayout, it doesn’t fit to the full width of the screen. How can I make this possible? This is my XML: <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” …

Add android:name="something" to AndroidManifest.xml "application" tag from Cordova plugin.xml-ThrowExceptions

Exception or error: I decided to open new question because none of those that are already posted, has a good answer. I need to update AndroidManifest.xml “from plugin.xml”, so that the <application> tag has the following property, alongside those it already has: android:name=”mypackage” How can do that? Thank you How to solve: I had the …

Android xml merge layout error on inflate-ThrowExceptions

Exception or error: I have a CustomView class and I want to use xml layout for it. So, my class extends RelativeLayout, inflates xml layout and tries to attach it to self. public class CustomView extends RelativeLayout { public CustomView (Context context) { super(context); LayoutInflater.from(context).inflate(R.layout.layers_list_item, this, true); } } If my xml layout has some …

android – dimen.xml or dimens.xml?-ThrowExceptions

Exception or error: I usually store dimensions in dimen.xml file. However, IntelliJ IDEA’s intellisense places dimensions into file dimens.xml. Now, what if I place dimensions into the file dimens.xml, how will Eclipse handle this? I see that docs allow both files to be used. Which one should be used if the project will be used …

android – Can't use @string notation to define <intent-filter> in AndroidManifest.xml-ThrowExceptions

Exception or error: My BroadcastReceiver never gets called when I use “@string/action_name” to define the intent filter action. If I copy/paste the corresponding string from strings.xml into AndroidManifest.xml, then it works perfectly! Non working example from AndroidManifest.xml: <receiver android:name=”.ServerUpdateReceiver” > <intent-filter> <action android:name=”@string/ACTION_INFORM_USER_SERVER_UPDATE” /> </intent-filter> </receiver> Working example from AndroidManifest.xml: <receiver android:name=”.ServerUpdateReceiver” > <intent-filter> <action …

java – Cannot read packageName from AndroidManifest.xml-ThrowExceptions

Exception or error: I have errors in my android manifest file: Error:Cannot read packageName from C:\Users\brandon\AndroidStudioProjects\MineDodge2\app\src\main\AndroidManifest.x‌​ml Error:The markup in the document preceding the root element must be well-formed. I tried to look on this website but the answers aren’t working for me. <?xml version=”1.0″ encoding=”utf-8″?> < manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.example.brandon.MineDodge” > <application android:allowBackup=”true” android:icon=”@mipmap/redjet” android:label=”@string/app_name” android:theme=”@style/AppTheme” …

android – Screen orientation and values in manifest.xml-ThrowExceptions

Exception or error: I want to use all activities in my form in landscape or portrait. When user select orientation – this is valid for all activities. Tried with “behind” option orientation. According to Google – orientation will depend on previous activity. My first activity use setRequestedOrientation to set selected from user orientation. Next activities …

xml – Android Studio Error Duplicate Resource-ThrowExceptions

Exception or error: Error:Execution failed for task ‘:fiesCabs:mergeDebugResources’. C:\Users\tony\AndroidstudioProjects\Fies-Cabs\fiesCabs\src\main\res\values\themes_apptheme.xml: Error: Duplicate resources: C:\Users\tony\AndroidstudioProjects\Fies-Cabs\fiesCabs\src\main\res\values\themes_apptheme.xml:style/AppTheme, C:\Users\tony\AndroidstudioProjects\Fies-Cabs\fiesCabs\src\main\res\values\styles.xml:style/AppTheme Error:Error: Duplicate resources: C:\Users\tony\AndroidstudioProjects\Fies-Cabs\fiesCabs\src\main\res\values\themes_apptheme.xml:style/AppTheme, C:\Users\tony\AndroidstudioProjects\Fies-Cabs\fiesCabs\src\main\res\values\styles.xml:style/AppTheme Error shown in android studio while building the project themes_apptheme.xml <?xml version=”1.0″ encoding=”utf-8″?> <!– Generated with http://android-holo-colors.com –> <resources xmlns:android=”http://schemas.android.com/apk/res/android”> <style name=”AppTheme” parent=”@style/_AppTheme”/> <style name=”_AppTheme” parent=”Theme.AppCompat.Light”> <item name=”android:editTextStyle”>@style/EditTextAppTheme</item> <item name=”android:textColorHighlight”>#9933b5e5</item> <item name=”android:autoCompleteTextViewStyle”>@style/AutoCompleteTextViewAppTheme</item> <item name=”android:checkboxStyle”>@style/CheckBoxAppTheme</item> <item name=”android:radioButtonStyle”>@style/RadioButtonAppTheme</item> …

xml – android image button tooltip-ThrowExceptions

Exception or error: I’m trying to build an app with image buttons that work like the action bar but i can’t get them to show a tooltip on long press. <ImageButton android:id=”@+id/editUrgent” style=”?android:attr/borderlessButtonStyle” android:layout_width=”48dp” android:layout_height=”wrap_content” android:layout_centerVertical=”true” android:layout_toLeftOf=”@+id/editImportant” android:hint=”@string/hint_urgent” android:contentDescription=”@string/hint_urgent” android:text=”@string/hint_urgent” android:src=”@drawable/clock_light” /> android:contentDescription works for hovering(s-pen) but long press still does nothing. How to solve: …

android – Set text size in .xml or programmatically-ThrowExceptions

Exception or error: I have variable at dimens.xml <resources> <dimen name=”btn_text_size”>12sp</dimen> </resources> And i can use it in layout file: <TextView android:textSize=”@dimen/btn_text_size” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”@string/dialog_tags_complete” /> or programmatically tagButton.setTextSize(c.getResources().getDimension(R.dimen.tag_text_size)); But this 2 methods give different results. I know that getDimension are based on the current DisplayMetrics associated with the resources. But what should i do …