小编Igo*_*nov的帖子

SearchView中的onQueryTextSubmit在Android Java中处理两次

为什么onQueryTextSubmit方法in SearchView被处理两次?我需要一个结果,我该怎么做?

这是我的代码:

 public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_main, menu);
    SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override
        public boolean onQueryTextSubmit(String query) {
            if (query != null)
                audioRequest(query);
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            return false;
        }
    });
    return true;
}
Run Code Online (Sandbox Code Playgroud)

java android searchview

8
推荐指数
2
解决办法
3164
查看次数

Yii2 DepDrop kartik

好的我正在尝试使用Kartik Depdrop小部件,但得到此错误500(内部服务器错误)

我有父模型品牌和子模型CarModel

这是我的文件:

CarsController.php

public function actionSubcat() {
    $out = [];
    if (isset($_POST['depdrop_parents'])) {
        $parents = $_POST['depdrop_parents'];
        if ($parents != null) {
            $cat_id = $parents[0];
            $out = self::getSubCatList($cat_id);
            // the getSubCatList function will query the database based on the
            // cat_id and return an array like below:
            // [
            //    ['id'=>'<sub-cat-id-1>', 'name'=>'<sub-cat-name1>'],
            //    ['id'=>'<sub-cat_id_2>', 'name'=>'<sub-cat-name2>']
            // ]
            echo Json::encode(['output'=>$out, 'selected'=>'']);
            return;
        }
    }
    echo Json::encode(['output'=>'', 'selected'=>'']);
}
Run Code Online (Sandbox Code Playgroud)

模型Cars.php

public function getSubCatList($cat_id)
{
    $data=\common\models\CarModel::find()
       ->where(['brand_id'=>$cat_id])
       ->select(['id','name_ru AS name' …
Run Code Online (Sandbox Code Playgroud)

php yii2

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

Sugar ORM没有这样的表异常

Sugar ORM在Android <5上完美运行,但在Android 5上它崩溃了.我使用的是1.4版

请帮我.

错误: android.database.sqlite.SQLiteException: no such table: AUDIO (code 1): , while compiling: SELECT * FROM AUDIO

proguard-rules.pro

-keep class me.lobanov.mp3downloadsfree.models.** { *; }
Run Code Online (Sandbox Code Playgroud)

我的模特课:

package me.lobanov.mp3downloadsfree.models;

import com.orm.SugarRecord;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class Audio extends SugarRecord {
    private long aud_id;
    private String aud_artist;
    private String aud_title;
    private String aud_url;
    private long aud_duration;

    public Audio() {
    }

    public Audio(long aud_id, String aud_artist, String aud_title, String aud_url, long aud_duration){
        this.aud_id = aud_id; …
Run Code Online (Sandbox Code Playgroud)

sqlite android sugarorm

3
推荐指数
1
解决办法
8693
查看次数

标签 统计

android ×2

java ×1

php ×1

searchview ×1

sqlite ×1

sugarorm ×1

yii2 ×1