大约有 3,614 项符合查询结果(耗时:0.0150秒) [XML]
Android: Specify two different images for togglebutton using XML
... following manner to ensure they will all be utilized:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:state_pressed="true" /> //currently pressed turning the toggle on
<item android:state_pressed="true" /> /...
How to disable / enable dialog negative positive buttons?
...lder builder = new AlertDialog.Builder(MainActivity.this);
builder.setIcon(android.R.drawable.ic_dialog_info);
builder.setTitle("Alert dialog title");
builder.setMessage("This is the example code snippet to disable button if edittext attached to dialog is empty.");
builder.setPositiveButton("Positiv...
Understanding colors on Android (six characters)
I am trying to understand how colors work in Android. I have this color set as the background of my LinearLayout , and I get a background gray with some transparency:
...
Adding local .aar files to Gradle build using “flatDirs” is not working
...name of your aar file)
build
gradle
etc
This worked for me running Android Studio 0.8.0. Don't forget to synchronize gradle (using toolbar button or in File->Synchronize) after you do this.
(Thanks to Josiah for getting me going in the right direction)
(Note: prior to this I tried addin...
Singletons vs. Application Context in Android?
... several problems of using singletons
and having seen several examples of Android applications using singleton pattern, I wonder if it's a good idea to use Singletons instead of single instances shared through global application state (subclassing android.os.Application and obtaining it through con...
How to add -Xlint:unchecked to my Android Gradle based project?
...more than 10 upvotes, it does not address the problem in the context of an Android project. However, Google finds this question in the context of non-Android projects. Thus, I keep this answer for those folks.
According to JavaCompile, the following seems to be solution:
compileJava {
options...
How do I hide a menu item in the actionbar?
...default in menu xml
By default the share button will be hidden, as set by android:visible="false".
main_menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
&l...
Android: AutoCompleteTextView show suggestions when no text entered
...Complete. It's something between AutoCompleteTextView and Spinner.
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.AutoCompleteTextView;
public class InstantAutoComplete extends AutoCompleteTextView {
public InstantAutoCo...
Why doesn't “System.out.println” work in Android?
...onsole, so that I can debug it. But for some reason, nothing prints in my Android application.
11 Answers
...
Error to run Android Studio
I have installed Android Studio and I followed all steps described here
17 Answers
17...