2

On 3 other devices I am able to use my program and long press text in an EditText field without seeing any issues, but on my galaxy S3 whenever I try to do it the program crashes. This is on a very basic activity page where I am not doing much more than showing an EditText and a button. But it is happening everywhere else there is an EditText within my program.

Logcat info on crash here:

01-15 10:56:47.169: E/AndroidRuntime(3516): FATAL EXCEPTION: main
01-15 10:56:47.169: E/AndroidRuntime(3516): android.content.res.Resources$NotFoundException: Resource ID #0x0
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.content.res.Resources.getValue(Resources.java:1981)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.content.res.Resources.getDrawable(Resources.java:1556)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.widget.Editor$SelectionModifierCursorController.initDrawables(Editor.java:5506)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.widget.Editor$SelectionModifierCursorController.show(Editor.java:5490)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.widget.Editor$SelectionActionModeCallback.onCreateActionMode(Editor.java:3459)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2768)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionModeForChild(PhoneWindow.java:2654)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:696)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:696)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:696)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:696)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:696)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:696)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.View.startActionMode(View.java:4587)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.widget.Editor.startSelectionActionMode(Editor.java:1814)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.widget.Editor.performLongClick(Editor.java:1042)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.widget.TextView.performLongClick(TextView.java:9589)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.view.View$CheckForLongPress.run(View.java:18775)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.os.Handler.handleCallback(Handler.java:730)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.os.Looper.loop(Looper.java:137)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at android.app.ActivityThread.main(ActivityThread.java:5455)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at java.lang.reflect.Method.invokeNative(Native Method)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at java.lang.reflect.Method.invoke(Method.java:525)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
01-15 10:56:47.169: E/AndroidRuntime(3516):     at dalvik.system.NativeStart.main(Native Method)

Does anyone know how I can fix this?


Cleaning the project did not work so here is the source code for the activity page:

package com.BretonSmarTek.FireQueue;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;

import com.BretonSmarTek.FireQueue.R;

public class miscPage extends Activity {

    private TextView tv;
    private EditText mTextInfo;
    private CheckBox mSendToAll;
    private Button mDoAction;
    private int defChoice;

    private static final String TAG = "miscPage";


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


    public void setupInterface(){
        mDoAction = (Button) findViewById(R.id.btnDoAction);
        tv = (TextView)findViewById(R.id.charCountLabel);
        mTextInfo = (EditText) findViewById(R.id.miscText);

        SharedPreferences settings = getSharedPreferences("GeneralPrefs", 2);
        final String name = settings.getString("FName", "") + " " + settings.getString("LName", "");
        final String maxChars = Integer.toString(319 - name.length());//319 beacuse of the space before name
        mTextInfo.setFilters(new InputFilter[] { new InputFilter.LengthFilter(Integer.parseInt(maxChars)) });

        mTextInfo.addTextChangedListener(new TextWatcher(){
            public void afterTextChanged(Editable s) {
                tv.setText(" - " + name + " " + String.valueOf(mTextInfo.length() + " / " + maxChars));
            }
            public void beforeTextChanged(CharSequence s, int start, int count, int after){
            }
            public void onTextChanged(CharSequence s, int start, int before, int count){
            }
        }); 
        mSendToAll = (CheckBox) findViewById(R.id.chk_sendToAll);

        mDoAction.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                //sendMessage
            }
        });
    }

}
Bryan
  • 623
  • 1
  • 6
  • 23

0 Answers0