小编Joh*_*Joe的帖子

app:popupTheme ="@ style/AppTheme.PopupOverlay" - 无法转换为变量

在为Android Studio开发界面时,我的XML文件字段存在一个小问题.当鼠标悬停在我的上方时app:popupTheme= "@style/AppTheme.PopupOverlay",我收到一条错误消息,表示"无法解析为变量"字段.

android

7
推荐指数
2
解决办法
2万
查看次数

EditText afterTextChanged不起作用

我使用下面的代码插入Uri图像SQLite:

寄存器

private void insertData( String name,String pass, Uri image) throws SQLiteException {
        database = mdb.getWritableDatabase();
        ContentValues cv = new ContentValues();
        cv.put(MyDatabaseHelper.KEY_NAME,    name);
        cv.put(MyDatabaseHelper.KEY_PASSWORD, pass);
        try {
            database = mdb.getWritableDatabase();
            InputStream iStream = getContentResolver().openInputStream(image);
            byte[] inputData = Utils.getBytes(iStream);
            cv.put(MyDatabaseHelper.KEY_IMAGE,inputData);
        }catch(IOException ioe)
        {
            Log.e(TAG, "<saveImageInDB> Error : " + ioe.getLocalizedMessage());
        }
        database.insert(MyDatabaseHelper.TABLE_USER, null, cv);
        Toast.makeText(getApplicationContext(),"Database Created",Toast.LENGTH_SHORT).show();
        database.close();
    }
Run Code Online (Sandbox Code Playgroud)

在我得到的时候Database Created,我假设数据库已成功创建并插入了数据.

Login中,我想要SQLite根据用户名检索图像.

name = (EditText) findViewById(R.id.name);

name.addTextChangedListener(new TextWatcher() {
    @Override
    public void …
Run Code Online (Sandbox Code Playgroud)

sqlite android uri imageview android-edittext

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

如何在Spring-retry(Spring Boot)中配置延迟时间

是否可以配置@Retryable?这个方法(getCurrentRate)将被调用3次.首先是5分钟,然后是10分钟,最后是15分钟.我该如何配置?

@Retryable(maxAttempts=3,value=RuntimeException.class,backoff = @Backoff(delay = 1000))
Run Code Online (Sandbox Code Playgroud)

public class RealExchangeRateCalculator implements ExchangeRateCalculator {

    private static final double BASE_EXCHANGE_RATE = 1.09;
    private int attempts = 0;
    private SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

   @Retryable(maxAttempts=3,value=RuntimeException.class,backoff = @Backoff(delay = 1000))
    public Double getCurrentRate() {

        System.out.println("Calculating - Attempt " + attempts + " at " + sdf.format(new Date()));
        attempts++;

        try {
            HttpResponse<JsonNode> response = Unirest.get("http://rate-exchange.herokuapp.com/fetchRate")
                .queryString("from", "EUR")
                .queryString("to","USD")
                .asJson();

            switch (response.getStatus()) {
            case 200:
                return response.getBody().getObject().getDouble("Rate");
            case 503:
                throw new RuntimeException("Server …
Run Code Online (Sandbox Code Playgroud)

java rest spring spring-boot

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

invalidateOptionsMenu()已弃用

在我的一个片段类中,我使用invalidateOptionsMenu()如下

invalidateOptionsMenu(activity)
Run Code Online (Sandbox Code Playgroud)

但已弃用

不推荐使用“ invalidateOptionsMenu(Activity!):布尔值”。Java中不推荐使用

有什么可以替代的invalidateOptionsMenu(Activity activity)

P / S:这种方法仍然可以使用,但是将来会成为问题吗?

android fragment deprecated kotlin

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

Flutter pub 出现错误( open_file_safe ^3.2.3 和 file_picker ^5.2.2 )如何解决此问题?

运行 pub get 后,我​​收到以下错误(第一次构建)

Because file_picker >=5.0.0 depends on ffi ^2.0.1 and open_file_safe 3.2.3 depends on ffi ^1.0.0, file_picker >=5.0.0 is incompatible with open_file_safe 3.2.3.
And because no versions of open_file_safe match >3.2.3 <4.0.0, file_picker >=5.0.0 is incompatible with open_file_safe ^3.2.3.
So, because app depends on both open_file_safe ^3.2.3 and file_picker ^5.2.2, version solving failed.
pub get failed (1; So, because app depends on both open_file_safe ^3.2.3 and file_picker ^5.2.2, version solving failed.)
Run Code Online (Sandbox Code Playgroud)

我尝试运行pub get命令并希望它能够成功运行而不会出现任何错误。

filepicker flutter

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

SQLite插入或替换位置

我有一个包含3列,ID,描述和密钥的表,其中ID不是主键!我想要的是插入或更新/替换当前记录.示例:decryptionKeys ID描述密钥999生日24.12.1988

我尝试了这个但是它不起作用:

INSERT OR REPLACE INTO decryptionKeys VALUES ("999","Birthday","25.12.1988") WHERE ID="999" AND Description="Birthday"
Run Code Online (Sandbox Code Playgroud)

sql sqlite

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

在 poi-4.0.1 中找不到符号变量 Cell.CELL_TYPE_STRING

有人可以用这个错误回答我吗,我正在使用 poi-4.0.1

error: cannot find symbol
symbol: variable CELL_TYPE_STRING
location: interface Cell
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

 if(Cell.CELL_TYPE_STRING == cell.getCellType()){
}
Run Code Online (Sandbox Code Playgroud)

java apache-poi

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

找不到与给定名称匹配的资源(在'android:color Primary')

<resources>
  <!-- inherit from the material theme -->
 <style name="AppTheme" parent="android:Theme.Material">
   <!-- Main theme colors -->
   <!--   your app branding color for the app bar -->
   <item name="android:colorPrimary">@color/primary</item>
   <!--   darker variant for the status bar and contextual app bars -->
   <item name="android:colorPrimaryDark">@color/primary_dark</item>
   <!--   theme UI controls like checkboxes and text fields -->
   <item name="android:colorAccent">@color/accent</item>
 </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

请尝试解决问题.

android material-design

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

如何从Object []转换为int []

我想传递myVector给另一个类(Case.java)但我得到这种错误消息.类型不匹配:无法从Object []转换为int [].谁能告诉我怎么解决这个问题?

User.java

JButton btnNewButton = new JButton("Process");

btnNewButton.setBounds(360, 296, 89, 23);
contentPane.add(btnNewButton);

btnNewButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        Integer a = (comboBox.getSelectedIndex() + 1);
        Integer b = (comboBox_1.getSelectedIndex() + 1);
        Integer day = (comboBox_2.getSelectedIndex() + 1);
        ArrayList<Integer> myVector = new ArrayList<Integer>();
        myVector.add(a);
        myVector.add(b);
        myVector.add(day);

        Case ca = new Case();
        try {
            ca.addPlace(myVector);
            LoginGUI um = new LoginGUI();
            um.setVisible(true);

        } catch (Exception e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        } …
Run Code Online (Sandbox Code Playgroud)

java vector cosine-similarity

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

在Springboot中使用EntityManager

我想用EntityManagerSpringBoot.

应用

@Configuration
@EnableRetry // To enable Spring retry
@EnableJpaRepositories
@EnableAspectJAutoProxy(proxyTargetClass=true)
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }    
}
Run Code Online (Sandbox Code Playgroud)

邮件配置

@Configuration
@EnableJpaRepositories(
        entityManagerFactoryRef = "mailEntityManager",
        transactionManagerRef = "mailTransactionManager",
        basePackageClasses = MmcMonitoringLog.class)

public class MailConfig {

    @Autowired(required = false)
    private PersistenceUnitManager persistenceUnitManager;

    @Bean
    @ConfigurationProperties("app.order.jpa")
    public JpaProperties orderJpaProperties() {
        return new JpaProperties();
    }

    @Bean
    @ConfigurationProperties(prefix = "app.order.datasource")
    public DataSource orderDataSource() {
        return …
Run Code Online (Sandbox Code Playgroud)

java spring jpa spring-boot

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