当我单击“完成”键时,Android OnEditorActionListener() actionId 给出 0

2024-05-14

我创建了一个键盘。当用户输入数字时,它会输入特定的 EditText。但是当用户单击Done关键,它没有去setOnEditorActionListener但它关闭了键盘。

这是我的代码:

 final EditText txtQty = new EditText(this);
        txtQty.setHeight(1);
        txtQty.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 42));
        txtQty.setInputType(InputType.TYPE_CLASS_PHONE);
        txtQty.setImeOptions(EditorInfo.IME_ACTION_DONE);
        txtQty.setSelectAllOnFocus(true);
        txtQty.setTextSize(9);
        txtQty.setVisibility(View.VISIBLE);
        txtQty.setHint("0.0");
        txtQty.setHighlightColor(R.color.green);
        tr.addView(txtQty);
 txtQty.setOnEditorActionListener( new OnEditorActionListener() {
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                Log.i("KeyBoard" ,"Inside the Edit Text");
                if (actionId == EditorInfo.IME_ACTION_DONE ||actionId == EditorInfo.IME_ACTION_NEXT ) { ......}

这里给出actionId = 0 和 EditorInfo.IME_ACTION_NEXT =5

当我运行 Android 时,软键盘工作正常

 txtQty.setOnEditorActionListener( new OnEditorActionListener() {
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                Log.i("KeyBoard" ,"Inside the Edit Text");
                Log.i("---EditorInfo.IME_ACTION_NEXT---" , EditorInfo.IME_ACTION_NEXT);
                Log.i("---actionId---" , actionId);
                Log.i("---event---" , event);
                Log.i("---EditorInfo.IME_ACTION_DONE---" , EditorInfo.IME_ACTION_DONE);

在这里给予EditorInfo.IME_ACTION_NEXT =5 , actionId =5 & EditorInfo.IME_ACTION_DONE = 6, actionId=6但是当我运行我的软键盘时EditorInfo.IME_ACTION_NEXT =5 , actionId =0 & EditorInfo.IME_ACTION_DONE = 6, actionId=0

这就是问题所在,哪里错了?为什么没有采取actionId value?

这是我正在做的场景:

编辑/更新

    public class SoftKeyboard extends InputMethodService implements KeyboardView.OnKeyboardActionListener {
    static final boolean DEBUG = false;
    static final boolean PROCESS_HARD_KEYS = true;
    private KeyboardView mInputView;
    private CandidateView mCandidateView;
    private CompletionInfo[] mCompletions;
    private StringBuilder mComposing = new StringBuilder();
    private boolean mPredictionOn;
    private boolean mCompletionOn;
    private int mLastDisplayWidth;
    private boolean mCapsLock;
    private long mLastShiftTime;
    private long mMetaState;
    private LatinKeyboard mSymbolsKeyboard;
    private LatinKeyboard mSymbolsShiftedKeyboard;
    private LatinKeyboard mQwertyKeyboard;
    private LatinKeyboard mCurKeyboard; 
    private String mWordSeparators;

    @Override public void onCreate() {
        super.onCreate();
        mWordSeparators = getResources().getString(R.string.word_separators);
    }

    @Override public void onInitializeInterface() {
        if (mQwertyKeyboard != null) {
            int displayWidth = getMaxWidth();
            if (displayWidth == mLastDisplayWidth) return;
            mLastDisplayWidth = displayWidth;
        }
        mQwertyKeyboard = new LatinKeyboard(this, R.xml.qwerty);
        mSymbolsKeyboard = new LatinKeyboard(this, R.xml.symbols);
        mSymbolsShiftedKeyboard = new LatinKeyboard(this, R.xml.symbols_shift);
    }


    @Override public View onCreateInputView() {
        mInputView = (KeyboardView) getLayoutInflater().inflate(
                R.layout.input, null);
        mInputView.setOnKeyboardActionListener(this);
        mInputView.setKeyboard(mQwertyKeyboard);
        return mInputView;
    }

    @Override public View onCreateCandidatesView() {
        mCandidateView = new CandidateView(this);
        mCandidateView.setService(this);
        return mCandidateView;
    }

    @Override public void onStartInput(EditorInfo attribute, boolean restarting) {
        super.onStartInput(attribute, restarting);

        mComposing.setLength(0);
        updateCandidates();

        if (!restarting) {
            mMetaState = 0;
        }

        mPredictionOn = false;
        mCompletionOn = false;
        mCompletions = null;

        switch (attribute.inputType&EditorInfo.TYPE_MASK_CLASS) {
            case EditorInfo.TYPE_CLASS_NUMBER:
            case EditorInfo.TYPE_CLASS_DATETIME:
                mCurKeyboard = mSymbolsKeyboard;
                break;

            case EditorInfo.TYPE_CLASS_PHONE:
                mCurKeyboard = mSymbolsKeyboard;
                break;

            case EditorInfo.TYPE_CLASS_TEXT:
                mCurKeyboard = mQwertyKeyboard;
                mPredictionOn = true;
                int variation = attribute.inputType &  EditorInfo.TYPE_MASK_VARIATION;
                if (variation == EditorInfo.TYPE_TEXT_VARIATION_PASSWORD ||
                        variation == EditorInfo.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) {
                    mPredictionOn = false;
                }

                if (variation == EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS 
                        || variation == EditorInfo.TYPE_TEXT_VARIATION_URI
                        || variation == EditorInfo.TYPE_TEXT_VARIATION_FILTER) {
                    mPredictionOn = false;
                }

                if ((attribute.inputType&EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) {

                    mPredictionOn = false;
                    mCompletionOn = isFullscreenMode();
                }

                updateShiftKeyState(attribute);
                break;

            default:
                mCurKeyboard = mQwertyKeyboard;
                updateShiftKeyState(attribute);
        }
        mCurKeyboard.setImeOptions(getResources(), attribute.imeOptions);
    }

    @Override public void onFinishInput() {
        super.onFinishInput();

        // Clear current composing text and candidates.
        mComposing.setLength(0);
        updateCandidates();
        setCandidatesViewShown(false);

        mCurKeyboard = mQwertyKeyboard;
        if (mInputView != null) {
            mInputView.closing();
        }
    }

    @Override public void onStartInputView(EditorInfo attribute, boolean restarting) {
        super.onStartInputView(attribute, restarting);
        mInputView.setKeyboard(mCurKeyboard);
        mInputView.closing();
    }

    @Override 
    public void onUpdateSelection(int oldSelStart, int oldSelEnd,
            int newSelStart, int newSelEnd,
            int candidatesStart, int candidatesEnd) {
        super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd,
                candidatesStart, candidatesEnd);
        if (mComposing.length() > 0 && (newSelStart != candidatesEnd
                || newSelEnd != candidatesEnd)) {
            mComposing.setLength(0);
            updateCandidates();
            InputConnection ic = getCurrentInputConnection();
            if (ic != null) {
                ic.finishComposingText();
            }
        }
    }

    @Override 
    public void onDisplayCompletions(CompletionInfo[] completions) {
        if (mCompletionOn) {
            mCompletions = completions;
            if (completions == null) {
                setSuggestions(null, false, false);
                return;
            }

            List<String> stringList = new ArrayList<String>();
            for (int i=0; i<(completions != null ? completions.length : 0); i++) {
                CompletionInfo ci = completions[i];
                if (ci != null) stringList.add(ci.getText().toString());
            }
            setSuggestions(stringList, true, true);
        }
    }

    private boolean translateKeyDown(int keyCode, KeyEvent event) {
        mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
                keyCode, event);
        int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
        mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
        InputConnection ic = getCurrentInputConnection();
        if (c == 0 || ic == null) {
            return false;
        }

        boolean dead = false;

        if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
            dead = true;
            c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
        }

        if (mComposing.length() > 0) {
            char accent = mComposing.charAt(mComposing.length() -1 );
            int composed = KeyEvent.getDeadChar(accent, c);

            if (composed != 0) {
                c = composed;
                mComposing.setLength(mComposing.length()-1);
            }
        }

        onKey(c, null);

        return true;
    }


    @Override 
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK:
                if (event.getRepeatCount() == 0 && mInputView != null) {
                    if (mInputView.handleBack()) {
                        return true;
                    }
                }
                break;

            case KeyEvent.KEYCODE_DEL:
                if (mComposing.length() > 0) {
                    onKey(Keyboard.KEYCODE_DELETE, null);
                    return true;
                }
                break;

            case KeyEvent.KEYCODE_ENTER:
                return false;



            default:
                if (PROCESS_HARD_KEYS) {
                    if (keyCode == KeyEvent.KEYCODE_SPACE
                            && (event.getMetaState()&KeyEvent.META_ALT_ON) != 0) {
                        InputConnection ic = getCurrentInputConnection();
                        if (ic != null) {
                            ic.clearMetaKeyStates(KeyEvent.META_ALT_ON);
                            keyDownUp(KeyEvent.KEYCODE_A);
                            keyDownUp(KeyEvent.KEYCODE_N);
                            keyDownUp(KeyEvent.KEYCODE_D);
                            keyDownUp(KeyEvent.KEYCODE_R);
                            keyDownUp(KeyEvent.KEYCODE_O);
                            keyDownUp(KeyEvent.KEYCODE_I);
                            keyDownUp(KeyEvent.KEYCODE_D);
                            return true;
                        }
                    }
                    if (mPredictionOn && translateKeyDown(keyCode, event)) {
                        return true;
                    }
                }
        }

        return super.onKeyDown(keyCode, event);
    }

    @Override 
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (PROCESS_HARD_KEYS) {
            if (mPredictionOn) {
                mMetaState = MetaKeyKeyListener.handleKeyUp(mMetaState,
                        keyCode, event);
            }
        }

        return super.onKeyUp(keyCode, event);
    }

    private void commitTyped(InputConnection inputConnection) {
        if (mComposing.length() > 0) {
            inputConnection.commitText(mComposing, mComposing.length());
            mComposing.setLength(0);
            updateCandidates();
        }
    }

    private void updateShiftKeyState(EditorInfo attr) {
        if (attr != null 
                && mInputView != null && mQwertyKeyboard == mInputView.getKeyboard()) {
            int caps = 0;
            EditorInfo ei = getCurrentInputEditorInfo();
            if (ei != null && ei.inputType != EditorInfo.TYPE_NULL) {
                caps = getCurrentInputConnection().getCursorCapsMode(attr.inputType);
            }
            mInputView.setShifted(mCapsLock || caps != 0);
        }
    }

    private boolean isAlphabet(int code) {
        if (Character.isLetter(code)) {
            return true;
        } else {
            return false;
        }
    }

    private void keyDownUp(int keyEventCode) {
        getCurrentInputConnection().sendKeyEvent(
                new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode));
        getCurrentInputConnection().sendKeyEvent(
                new KeyEvent(KeyEvent.ACTION_UP, keyEventCode));
    }

    private void sendKey(int keyCode) {
        switch (keyCode) {
            case '\n':
                keyDownUp(KeyEvent.KEYCODE_ENTER);
                break;
            default:
                if (keyCode >= '0' && keyCode <= '9') {
                    keyDownUp(keyCode - '0' + KeyEvent.KEYCODE_0);
                } else {
                    getCurrentInputConnection().commitText(String.valueOf((char) keyCode), 1);
                }
                break;
        }
    }


    public void onKey(int primaryCode, int[] keyCodes) {
        if (isWordSeparator(primaryCode)) {
            // Handle separator
            if (mComposing.length() > 0) {
                commitTyped(getCurrentInputConnection());
            }
            sendKey(primaryCode);
            updateShiftKeyState(getCurrentInputEditorInfo());
        } else if (primaryCode == Keyboard.KEYCODE_DELETE) {
            handleBackspace();
        } else if (primaryCode == Keyboard.KEYCODE_SHIFT) {
            handleShift();
        } else if (primaryCode == Keyboard.KEYCODE_CANCEL) {
            handleClose();
            return;
        } else if (primaryCode == LatinKeyboardView.KEYCODE_OPTIONS) {
            // Show a menu or somethin'
        } else if (primaryCode == Keyboard.KEYCODE_MODE_CHANGE
                && mInputView != null) {
            Keyboard current = mInputView.getKeyboard();
            if (current == mSymbolsKeyboard || current == mSymbolsShiftedKeyboard) {
                current = mQwertyKeyboard;
            } else {
                current = mSymbolsKeyboard;
            }
            mInputView.setKeyboard(current);
            if (current == mSymbolsKeyboard) {
                current.setShifted(false);
            }
        } else {
            handleCharacter(primaryCode, keyCodes);
        }
    }

    public void onText(CharSequence text) {
        InputConnection ic = getCurrentInputConnection();
        if (ic == null) return;
        ic.beginBatchEdit();
        if (mComposing.length() > 0) {
            commitTyped(ic);
        }
        ic.commitText(text, 0);
        ic.endBatchEdit();
        updateShiftKeyState(getCurrentInputEditorInfo());
    }

    private void updateCandidates() {
        if (!mCompletionOn) {
            if (mComposing.length() > 0) {
                ArrayList<String> list = new ArrayList<String>();
                list.add(mComposing.toString());
                setSuggestions(list, true, true);
            } else {
                setSuggestions(null, false, false);
            }
        }
    }

    public void setSuggestions(List<String> suggestions, boolean completions,
            boolean typedWordValid) {
        if (suggestions != null && suggestions.size() > 0) {
            setCandidatesViewShown(true);
        } else if (isExtractViewShown()) {
            setCandidatesViewShown(true);
        }
        if (mCandidateView != null) {
            mCandidateView.setSuggestions(suggestions, completions, typedWordValid);
        }
    }

    private void handleBackspace() {
        final int length = mComposing.length();
        if (length > 1) {
            mComposing.delete(length - 1, length);
            getCurrentInputConnection().setComposingText(mComposing, 1);
            updateCandidates();
        } else if (length > 0) {
            mComposing.setLength(0);
            getCurrentInputConnection().commitText("", 0);
            updateCandidates();
        } else {
            keyDownUp(KeyEvent.KEYCODE_DEL);
        }
        updateShiftKeyState(getCurrentInputEditorInfo());
    }

    private void handleShift() {
        if (mInputView == null) {
            return;
        }

        Keyboard currentKeyboard = mInputView.getKeyboard();
        if (mQwertyKeyboard == currentKeyboard) {
            // Alphabet keyboard
            checkToggleCapsLock();
            mInputView.setShifted(mCapsLock || !mInputView.isShifted());
        } else if (currentKeyboard == mSymbolsKeyboard) {
            mSymbolsKeyboard.setShifted(true);
            mInputView.setKeyboard(mSymbolsShiftedKeyboard);
            mSymbolsShiftedKeyboard.setShifted(true);
        } else if (currentKeyboard == mSymbolsShiftedKeyboard) {
            mSymbolsShiftedKeyboard.setShifted(false);
            mInputView.setKeyboard(mSymbolsKeyboard);
            mSymbolsKeyboard.setShifted(false);
        }
    }

    private void handleCharacter(int primaryCode, int[] keyCodes) {
        if (isInputViewShown()) {
            if (mInputView.isShifted()) {
                primaryCode = Character.toUpperCase(primaryCode);
            }
        }
        if (isAlphabet(primaryCode) && mPredictionOn) {
            mComposing.append((char) primaryCode);
            getCurrentInputConnection().setComposingText(mComposing, 1);
            updateShiftKeyState(getCurrentInputEditorInfo());
            updateCandidates();
        } else {
            getCurrentInputConnection().commitText(
                    String.valueOf((char) primaryCode), 1);
        }
    }

    private void handleClose() {
        commitTyped(getCurrentInputConnection());
        requestHideSelf(0);
        mInputView.closing();
    }

    private void checkToggleCapsLock() {
        long now = System.currentTimeMillis();
        if (mLastShiftTime + 800 > now) {
            mCapsLock = !mCapsLock;
            mLastShiftTime = 0;
        } else {
            mLastShiftTime = now;
        }
    }

    private String getWordSeparators() {
        return mWordSeparators;
    }

    public boolean isWordSeparator(int code) {
        String separators = getWordSeparators();
        return separators.contains(String.valueOf((char)code));
    }

    public void pickDefaultCandidate() {
        pickSuggestionManually(0);
    }

    public void pickSuggestionManually(int index) {
        if (mCompletionOn && mCompletions != null && index >= 0
                && index < mCompletions.length) {
            CompletionInfo ci = mCompletions[index];
            getCurrentInputConnection().commitCompletion(ci);
            if (mCandidateView != null) {
                mCandidateView.clear();
            }
            updateShiftKeyState(getCurrentInputEditorInfo());
        } else if (mComposing.length() > 0) {

            commitTyped(getCurrentInputConnection());
        }
    }

    public void swipeRight() {
        if (mCompletionOn) {
            pickDefaultCandidate();
        }
    }

    public void swipeLeft() {
        handleBackspace();
    }

    public void swipeDown() {
        handleClose();
    }

    public void swipeUp() {
    }

    public void onPress(int primaryCode) {
    }

    public void onRelease(int primaryCode) {
    }
}

和symbols.xml文件:

   <Key android:codes="-3" android:keyIcon="@drawable/sym_keyboard_done" android:keyWidth="20%p" android:keyEdgeFlags="left" />

当我点击Done关键我也没去OnEditorActionListener方法。请帮我

请帮我这个:


我已经尝试过这样的:但不是正确的解决方案。无论如何,我想采取actionId,根据actionId我想放置switch语句并想知道为什么当我们使用android键盘以外的时候它没有采取actionId

  txtQty.setOnEditorActionListener( new OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

         if(event.getKeyCode() == KeyEvent.KEYCODE_ENTER){ } .....

尝试添加 Listener :

    msg_title_text.setOnEditorActionListener(new DoneOnEditorActionListener());

创建了一个类:

    class DoneOnEditorActionListener implements OnEditorActionListener {
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (actionId == EditorInfo.IME_ACTION_DONE) {
            Log.v("*****************************", "Clicke da machan");
            // Do your Stuffs
            return true;    
        }
        return false;
    }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

当我单击“完成”键时,Android OnEditorActionListener() actionId 给出 0 的相关文章

  • 如何从自定义视图访问主机片段的生命周期范围?

    我需要在自定义视图中使用协程 看完这个之后 我相信我最好的选择是使用生命周期范围作为协程作用域 这样当lifecycleowner被销毁时 它会自动取消 但是我似乎无法访问自定义视图中的生命周期范围 根据文档 https developer
  • 调整 Android 日期选择器控件的大小

    如何将 android datepicker 控件的初始大小调整为更小或更大 有没有唯一的方法可以重新实现它 我一直无法找到调整其大小的方法 但已经看到了使用 DatePicker 作为对话框的实现 日期呈现为带有编辑按钮的 TextVie
  • Cordova 无法构建项目

    Update 新读者 请检查我最后的编辑 更新cordova后 无法构建 运行 Mac mini de Toni funcook toniweb sudo cordova build Password Running command Use
  • 使用意图过滤器从 URL 打开 Android 应用程序不起作用

    我有一个 Android 应用程序 人们用它来替代网站 因此 当用户遇到网站的 URL 时 我想为他们提供在我的应用程序中而不是在浏览器中 打开 URL 的选项 换句话说 我希望出现弹出窗口 让他们在我的应用程序和浏览器 可能还有其他应用程
  • Android MultiSelectListPreference,java.lang.String 无法转换为 java.util.Set

    我尝试为我的设置视图实现 MultiSelectListPreference
  • 为什么mapbox-android sdk 无法从build.gradle 解析?

    我试图在这里设置基本教程 但我被 Android Studio 中的错误阻止 https docs mapbox com android maps overview install the maps sdk https docs mapbo
  • 在原生 Android 应用程序中集成多个 Unity 游戏

    我有一个原生 Android 应用程序 我想在其中嵌入多个 Unity 游戏 我跟着link https medium com davidbeloosesky embedded unity within android app 7061f4
  • Compose-Navigation:在导航之前从堆栈中删除以前的可组合项

    我在用着compose navigation alpha09 处理可组合项之间的导航 我想删除启动画面当移动到下一个目的地时 我不希望背部受压返回 Splash 以下尝试未按预期工作 navHostController navigate R
  • 如何让按钮的角变圆?

    我想制作一个角button圆形的 在 Android 中是否有一种简单的方法可以实现这一点 如果你想要这样的东西 这是代码 1 在您的可绘制文件夹中创建一个 xml 文件 如 mybutton xml 并粘贴以下标记
  • 是否可以为 DialogFragment 制作动画?

    我尝试了有关片段动画的各种示例 但没有任何反应 所以 DialogFragment 不是 正确的 片段吗 或者我在这里遗漏了什么 FragmentTransaction ft getFragmentManager beginTransact
  • 在一天中的特定时间设置闹钟

    我正在尝试将闹钟设置在一天中的特定时间 例如 20 15 这是我正在使用的代码 但它不会在 20 15 关闭 Intent intent new Intent AlarmActivity this MyBroadcastReceiver c
  • Android - 使用 Intent 打开 PDF 文档关闭后不保存

    我面临的问题是 当尝试保存对使用此 URI 打开的 PDF 文档的更改时内容 xx xxx xxx fileprovider external Download Sync FileName pdf 我所做的任何更改在关闭文档后都不会保存 但
  • TextView 中缩进项目符号列表

    我有一个 TextView 我用 strings xml 中的字符串资源中的文本填充它 字符串资源包含 元素 用于在 TextView 内创建项目符号列表 我的问题是我想控制项目符号列表中跨越多行的行的缩进 默认情况下 文本不会缩进超过项目
  • Android Studio安装JDK错误

    In Android Studio I am facing bellow error 当我按下时会显示此弹出窗口Alt Enter对于缺少的类 符号 当我点击 setup SDK 时 它显示两个选项 1 8 Java版本 1 8 0 60
  • 清单合并失败:需要为 显式指定 android:exported

    我的清单文件有问题 错误消息 清单合并失败 android 需要为 明确指定导出 面向 Android 12 及更高版本的应用需要指定显式值android exported当相应的组件定义了意图过滤器时 有关详细信息 请参阅 https d
  • 选择活动时运行时崩溃

    首先我想说我几乎没有 Android 经验 这是我在 Android 中的第一个项目 而且我的老师不太擅长教学 所以我对任何过度的无知表示歉意 在进一步讨论之前先解释一下 我的应用程序的目标本质上是能够记录您在某些活动上花费了多少时间 记录
  • jarsigner:无法签署 jar:java.util.zip.ZipException:条目压缩大小无效(预期为 463,但实际为 465 字节)

    当我签署 apk 时 我收到 jarsigner 无法签署 jar java util zip ZipException 无效的条目压缩大小 预期 463 但获得 465 字节 此错误消息 apk大小接近1MB 当我将大小减小到500KB时
  • 找不到满足版本限制的“com.google.code.findbugs:jsr305”版本

    当生成签名的 APK 进行发布时 我收到此错误消息 Cannot find a version of com google code findbugs jsr305 that satisfies the version constraint
  • 在活动之间共享菜单栏

    我的应用程序上有一个菜单栏 我需要在 5 个活动之间共享该菜单栏 我的菜单栏 5 个允许在活动之间切换的按钮 对于任何活动具有完全相同的 UI 和相同的行为 因此我想共享菜单栏 XML 视图代码和控制器代码 我已经找到了一种使用共享 XML
  • 扩展Android应用程序类

    当我正在寻找从远程设备获取错误报告的解决方案时 就像 iOS 中的试飞应用程序一样 我发现了acra适用于 Android 设备here http code google com p acra wiki BasicSetup 在基本设置中

随机推荐

  • 如果执行了锚点 href 链接,则禁用 onClick 事件

    我有一张桌子 每一行都是一个由 js 调用的某个页面 例如 google com 的链接 onClick window open 方法 tr class tr 在最后一栏中我有一个锚点链接链接到其他页面 例如 jsfiddle td cla
  • 分配列表的多个值

    我很想知道是否有一种 Pythonic 方式将列表中的值分配给元素 为了更清楚 我要求这样的事情 myList 3 5 7 2 a b c d something myList So that a 3 b 5 c 7 d 2 我正在寻找比手
  • Lua 访问表的键和值

    我想在关卡编辑器中读取 Lua 文件 这样我就可以以可视化格式显示其数据供用户编辑 如果我有一个像这样的 Lua 表 properties Speed 10 TurnSpeed 5 Speed显然是关键并且10价值 我知道如果我知道像这样的
  • 使用 Idris 实现 isLast

    查看 Idris 类型驱动开发中的练习 9 2 data Last List a gt a gt Type where LastOne Last value value LastCons prf Last xs value gt Last
  • 如何告诉 JSHint 忽略一个文件中所有未定义的变量?

    在 Karma 测试中 有很多全局变量和函数 这是 JSHint 抱怨的 它已集成到我的编辑器中 我怎样才能告诉 JSHint 忽略这个特定文件中所有未定义的变量 我希望 jshint undef false 关闭这些警告 但事实并非如此
  • 如何在不使用 Firebase 控制台的情况下发送 Firebase 云消息通知?

    我从新的 Google 通知服务开始 Firebase Cloud Messaging 感谢这段代码https github com firebase quickstart android tree master messaging htt
  • 检测默认事件处理

    是否可以检测特定 DOM 事件是否绑定了任何事件处理程序 包括浏览器默认事件处理 在 Firefox 的 Greasemonkey 代码中 EcmaScript 5 1 严格模式 https developer mozilla org en
  • 使用 Zend Framework 2 生成 PDF 文件 [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我现在开始学习 ZF2 并注意到 zend Framework 2 上没有 Zend Pdf 或类似内容 如何在此版本的框架上创建 pdf
  • 为什么 pandas 在简单的数学运算上比 numpy 更快?

    最近 我观察到 pandas 的乘法速度更快 我在下面的例子中向您展示了这一点 如此简单的操作怎么可能做到这一点 这怎么可能呢 pandas 数据帧中的底层数据容器是 numpy 数组 测量 我使用形状为 10k 10k 的数组 数据框 i
  • 如何在 QTableView 标题中单击鼠标右键单击上下文菜单?

    下面的示例代码 很大程度上受到here http www saltycrane com blog 2007 12 pyqt 43 qtableview qabstracttablemodel 有一个右键单击上下文菜单 当用户单击表中的单元格
  • 区分大小写的实体识别

    我的关键字全部以小写形式存储 例如 折扣耐克鞋 我正在尝试对其执行实体提取 我遇到的问题是 spaCy 在 NER 方面似乎区分大小写 请注意 我不认为这是 spaCy 特有的 当我跑步时 doc nlp u i love nike sho
  • 由周期表元素形成的最大单词的算法

    我想为以下问题场景编写一个算法 根据元素周期表元素的名称 找到可以组成的最大单词 符号如Na Ne等应被视为单个元素 这是在一家知名公司的求职面试中被问到的 有人可以帮我解决这个问题吗 我认为更好的方法是检查字典中的每个单词 看看是否可以从
  • 将 UIRefreshControl 用于 UIWebView

    我在 iOS 6 中看到了 UIRefreshControl 我的问题是是否可以通过下拉来刷新 WebView 而不是像在邮件中那样让它弹出 我使用 rabih 的代码是 WebView UIRefreshControl refreshCo
  • Neo4j - 根据关系属性查找两个节点之间的最短路径

    我试图弄清楚是否有某种方法可以根据关系总和获得两个节点之间的最短距离 给出以下示例 neo4j 图像示例 https i stack imgur com fiJe1 png 上图代码 CREATE some point 1 Point ti
  • 按字节数对向量进行混洗

    有什么办法可以左移 v 0 gt v 1 a m128i by n字节 其中n仅在运行时才知道 我目前仅限于 AVX1 但如果 AVX2 512 使这变得更容易 我非常感兴趣 I found mm bslli si128 m128i imm
  • 如何使用 XSLT 从平面 XML 列表构建树?

    我使用极简 MVC 框架 其中PHP控制器手上的DOM模型 to the XSLT 视图 c f okapi http okapi liip ch 为了构建导航树 我在 MYSQL 中使用了嵌套集 这样 我最终得到一个如下所示的模型 XML
  • Resharper:使用 tab+tab 的代码片段

    在 VS 中 要使用片段 例如自动实现的属性 我输入 prop 然后按 TAB 两次 然而 R 我使用的是 R 6 会在一个选项卡后插入代码片段 导致我总是输入错误 是否有某个选项可以将其设置为使用two tabs 不幸的是 据我所知 您无
  • isModified 并预保存 mongoose...Nodejs

    您好 我只想在密码更改时使用散列密码保存 因此我在预保存中使用了 isModified 函数 但即使我更改了密码 它也总是返回 false 我尝试这样做的原因是因为我不想在更改其他属性时更改并保存我的密码 router post chang
  • 如何将一个表单的文件上传字段中的值复制到另一个表单的文本字段?

    我有一页上有两种不同的表格 第一个表单允许用户上传图像文件并通过电子邮件发送 第二个表单根据用户输入生成 URL 为了将图像名称添加到 URL 我需要在第二个表单中有一个字段 该字段从第一个表单的字段中复制图像名称 我不想让用户浏览并选择图
  • 当我单击“完成”键时,Android OnEditorActionListener() actionId 给出 0

    我创建了一个键盘 当用户输入数字时 它会输入特定的 EditText 但是当用户单击Done关键 它没有去setOnEditorActionListener但它关闭了键盘 这是我的代码 final EditText txtQty new E