小编Sta*_*ski的帖子

如何使 Android Studio 构建因 lint 错误而失败

是否有可能因 lint 检查错误而导致 Android Studio 构建失败?当我将图标从 .png 转换为矢量可绘制 .xml 时,我遇到了 ImageViews 问题。有时我忘记更改为, android:src="@drawable/ic_minus" 并且 app:srcCompat="@drawable/ic_minus" 应用程序在较旧的操作系统设备上崩溃。

android-lint android-studio

7
推荐指数
1
解决办法
2318
查看次数

火焰计划。未配置计费帐户。外部网络无法访问

当尝试使用 Firebase Cloud Function 内的库发送邮件时nodemailer。我收到错误:

Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions

我使用的是 Blaze(随用随付)计划。

google-cloud-functions google-cloud-firestore

5
推荐指数
1
解决办法
1842
查看次数

从后台线程异常在TextView上设置文本

我刚刚开始使用Android Concurrency / Loopers / Handers玩游戏,而且刚遇到奇怪的异常情况。下面的代码不会阻止我从其他线程在TextView上设置文本。

TextView tv;
Handler backgroundHandler;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tv = (TextView) findViewById(R.id.sample_text);
    Runnable run = new Runnable() {
        @Override
        public void run() {
            Looper.prepare();
            backgroundHandler = new Handler() {
                @Override
                public void handleMessage(Message msg) {
                    String text = (String) msg.obj;
                    tv.setText(Thread.currentThread().getName() + " " + text);
                }
            };
            Looper.loop();
        }
    };

    Thread thread = new Thread(run);
    thread.setName("Background thread");
    thread.start();
    try {
        Thread.sleep(100);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    Message …
Run Code Online (Sandbox Code Playgroud)

java multithreading android thread-safety

4
推荐指数
1
解决办法
758
查看次数