android-xml

How to configure application settings in android?

﹥>﹥吖頭↗ 提交于 2019-12-13 00:55:14
问题 In my application I have to keep some setting options for a user, like currency type, language, Calendar view (Either Calendar or List) etc. Here I am confused whether I have to configure all this by creating database tables or should keep this in any xlm or text file. Please guide if there any more convenient way? thanks. 回答1: you can use android shared preferences to store a users preferences. Alternatively you can store "global" variables if you create a Application instance which has

How to hide view behind the view

怎甘沉沦 提交于 2019-12-13 00:45:12
问题 I'm placing a textview over a line as textview have light color background the line behind the textview is visible, I want to hide that portion of line thats behind textview , how can i do that Thanks in advance! Like this 回答1: Try this <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match

How do I change the background color of default keyboard used in an app?

99封情书 提交于 2019-12-12 22:17:40
问题 So the app I am making requires a darker keyboard to be used (or else the contrast between content and keyboard is far too high), so I need to change what keyboard appears when I interact with an EditText. I've taken a look at the Android Soft Keyboard, but I'm having a hard time following it. If someone is able to help me with that, it'd be wonderful, though I am hoping there is an easier way out there already. Thanks. 回答1: If you want a keyboard with a specific look and feel in your app you

How to make a collapsing toolbar in android?

孤人 提交于 2019-12-12 13:26:01
问题 so im trying to implement a simple collapsing toolbar, but I don't think my xml layout is correct. The text is appearing the image and when I scroll down, I can't scroll back up to see the image. Hope you guys can help! <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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

Reason behind extra 8dp margin in a view ? not ways to solve

北战南征 提交于 2019-12-12 13:01:59
问题 In my activity xml file i am get an extra 8dp margin in Left side in view(Represented as Underline). Reason for getting 8dp margin extra in "view"? (underline under TextView.) i have given 48dp left margin in that view. above that view i have <TextView> which has a drawable icon in left. with left margin 24dp and drawable padding 24dp. Reason for doing. I am try to create an underline under my words using a view with black background. i have given 48dp as left margin in xml.but as shown in

Setting a custom share icon on Actionbar ShareActionProvider without ActionBarSherlock

一世执手 提交于 2019-12-12 10:55:18
问题 I have the same problem as was described here - Setting a custom share icon on Actionbar ShareActionProvider But I'am not using ActionBarSherlock I found that the Sherlock theme uses the " actionModeShareDrawable " and I can also use it like this, if I don't use ActionBarSherlock <style name="Theme.MyApp" parent="android:Theme.Holo"> <item name="*android:actionModeShareDrawable">@drawable/icon</item> </style> This works fine on my nexus 5, but failed on many other devices So my question is,

Adding my custom View into an XML layout throws exception

牧云@^-^@ 提交于 2019-12-12 10:35:25
问题 I'm trying to create my first custom View subclass GraphView and add it to my layout XML file. I found this SO question and tried to apply it to my project, but something seems to be wrong because Eclipse IDE tells me: de.muza3000.graph.GraphView failed to instantiate. and throws an exception: java.lang.NoSuchMethodException: de.muza3000.graph.GraphView.<init>(android.content.Context, android.util.AttributeSet) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class

Android File Provider Illegal Argument Exception

安稳与你 提交于 2019-12-12 09:33:08
问题 I am using file provider to save photo to a given destination. I get: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data while trying to open activity to capture image from camera. My manifest.xml file: <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.example" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/paths" />

Disabling the keyboard's send button when nothing has been typed yet [Android]

别等时光非礼了梦想. 提交于 2019-12-12 07:46:32
问题 I'm creating a search option in an android application. After pressing "Search" on the screen-keyboard an event triggers which sends the query to the server. What I want to do is disable the "Search" button on the screen-keyboard when no text has been typed in it's corresponding EditText yet. I added this to the EditText : android:imeOptions="actionSearch" So that's why the keyboard has got a "Search" button in stead of the default "enter"/"done". (Just in case you where wondering). 回答1: We

set Background Image and xml Resource

匆匆过客 提交于 2019-12-12 07:37:24
问题 I am using the following below code to round the corners of RelativeLayout. I save this as mybackground.xml in drawable folder. It's working fine for rounding the corner but the problem is that I also want to add an transparent image as a background of my RelativeLayout. How can I achieve both things? How can I use an image and a drawable xml (for rounding the corner) at the same time for a RelativeLayout ... <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android