小编Ras*_*eed的帖子

ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS :需要所有应用程序列表的意图

我需要意图“不优化” ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS 的设置页面。

但是当我将其更改为“不优化并返回”时,设置不会保存。它仍然会在“优化”列表中

设备:一加 5 操作系统:Android 9.0

代码 :

startActivityForResult(new Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS), 0);
Run Code Online (Sandbox Code Playgroud)

问题:设置未保存。

还有“电池优化应用程序列表”可用的意图吗?

android android-intent battery-saver android-9.0-pie

6
推荐指数
1
解决办法
6391
查看次数

在 React Native apollo 客户端中调用突变时如何传递附加标头?

在 React Native apollo 客户端中调用突变时如何传递附加标头?

我的客户在这里:

import { HttpLink } from 'apollo-link-http';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';

const makeApolloClient = (token) => {
  // create an apollo link instance, a network interface for apollo client
  const link = new HttpLink({
    uri: 'http://x.x.x.x:xxxx/xxxx',
    headers: {
     Authorization: `Bearer ${token}`
    },
  });
  // create an inmemory cache instance for caching graphql data
  const cache = new InMemoryCache();
  // instantiate apollo client with apollo link instance and …
Run Code Online (Sandbox Code Playgroud)

react-native react-apollo

5
推荐指数
2
解决办法
5423
查看次数